Skip to content

Commit

Permalink
Merge pull request #307 from LAMPSPUC/gb/fix-bsm-exogenous
Browse files Browse the repository at this point in the history
Fix Basic Structural Model with Explanatory
  • Loading branch information
guilhermebodin authored Mar 31, 2022
2 parents 8f08ab0 + 60a601c commit bea472c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- version: '1'
os: ubuntu-latest
arch: x64
- version: '1.0'
- version: '1.6'
os: ubuntu-latest
arch: x64
- version: '1.0'
- version: '1.6'
os: ubuntu-latest
arch: x86
steps:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StateSpaceModels"
uuid = "99342f36-827c-5390-97c9-d7f9ee765c78"
authors = ["raphaelsaavedra <[email protected]>, guilhermebodin <[email protected]>, mariohsouto"]
version = "0.6.1"
version = "0.6.2"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
4 changes: 2 additions & 2 deletions src/fit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ function fit!(
"If you are interested in estimates of the distribution of ther hyperparameters we advise you to" *
"change the optimization algorithm by using the kwarg fit(...; optimizer = "*
"Optimizer(StateSpaceModels.Optim.THE_METHOD_OF_YOUR_CHOICE()))" *
"The list of possible algorithms can be found on this link https://julianlsolvers.github.io/Optim.jl/stable/#" *
"Otherwise you can simply skip this proccess by using fit(...; save_hyperparameter_distribution=false) "
"The list of possible algorithms can be found on this link https://julianlsolvers.github.io/Optim.jl/stable/# " *
"otherwise you can simply skip this proccess by using fit(...; save_hyperparameter_distribution=false) "
)
std_err = fill(NaN, number_hyperparameters(model))
fill_results!(model, opt_loglikelihood, std_err)
Expand Down
4 changes: 2 additions & 2 deletions src/models/basicstructural_explanatory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ mutable struct BasicStructuralExplanatory <: StateSpaceModel
1 1 zeros(Fl, 1, s - 1) zeros(Fl, 1, num_exogenous)
0 1 zeros(Fl, 1, s - 1) zeros(Fl, 1, num_exogenous)
0 0 -ones(Fl, 1, s - 1) zeros(Fl, 1, num_exogenous)
zeros(Fl, s - 2, 2) Matrix{Fl}(I, s - 2, s - 2) zeros(Fl, s - 2) zeros(Fl, 10, num_exogenous)
zeros(Fl, num_exogenous, 13) Matrix{Fl}(I, num_exogenous, num_exogenous)
zeros(Fl, s - 2, 2) Matrix{Fl}(I, s - 2, s - 2) zeros(Fl, s - 2) zeros(Fl, s - 2, num_exogenous)
zeros(Fl, num_exogenous, s + 1) Matrix{Fl}(I, num_exogenous, num_exogenous)
] for _ in 1:num_observations]
R = [[
Matrix{Fl}(I, 3, 3)
Expand Down
3 changes: 3 additions & 0 deletions test/models/basicstructural_explanatory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
y = CSV.File(StateSpaceModels.AIR_PASSENGERS) |> DataFrame
logap = log.(y.passengers)
X = rand(length(logap), 2)
model = BasicStructuralExplanatory(logap, 10, X)
fit!(model)
model.results
model = BasicStructuralExplanatory(logap, 12, X)
fit!(model)
model.results
Expand Down

2 comments on commit bea472c

@guilhermebodin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/57690

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.2 -m "<description of version>" bea472c8d8200b357d096c6f27fc859e58949a5f
git push origin v0.6.2

Please sign in to comment.