Skip to content

Commit

Permalink
Fix Basic Structural Model with Explanatory
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermebodin committed Mar 31, 2022
1 parent 8f08ab0 commit 60a601c
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

0 comments on commit 60a601c

Please sign in to comment.