From 60a601ce5353d85c6fb52f6c911ce567ebaaee18 Mon Sep 17 00:00:00 2001 From: guilhermebodin Date: Thu, 31 Mar 2022 09:51:00 -0300 Subject: [PATCH] Fix Basic Structural Model with Explanatory --- .github/workflows/ci.yml | 4 ++-- Project.toml | 2 +- src/fit.jl | 4 ++-- src/models/basicstructural_explanatory.jl | 4 ++-- test/models/basicstructural_explanatory.jl | 3 +++ 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a233bd6f..f0a489ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/Project.toml b/Project.toml index a2a1c561..2ecfd4a0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StateSpaceModels" uuid = "99342f36-827c-5390-97c9-d7f9ee765c78" authors = ["raphaelsaavedra , guilhermebodin , mariohsouto"] -version = "0.6.1" +version = "0.6.2" [deps] Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" diff --git a/src/fit.jl b/src/fit.jl index 005de30d..06133a08 100644 --- a/src/fit.jl +++ b/src/fit.jl @@ -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) diff --git a/src/models/basicstructural_explanatory.jl b/src/models/basicstructural_explanatory.jl index 97e4452b..7e68446b 100644 --- a/src/models/basicstructural_explanatory.jl +++ b/src/models/basicstructural_explanatory.jl @@ -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) diff --git a/test/models/basicstructural_explanatory.jl b/test/models/basicstructural_explanatory.jl index 57afbc34..d5b28db4 100644 --- a/test/models/basicstructural_explanatory.jl +++ b/test/models/basicstructural_explanatory.jl @@ -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