diff --git a/Project.toml b/Project.toml index e987fdf..f0a6902 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StateSpaceLearning" uuid = "971c4b7c-2c4e-4bac-8525-e842df3cde7b" authors = ["andreramosfc "] -version = "1.3.1" +version = "1.3.2" [deps] Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" diff --git a/docs/src/examples.md b/docs/src/examples.md index ba1d16d..d0f2d3f 100644 --- a/docs/src/examples.md +++ b/docs/src/examples.md @@ -86,7 +86,7 @@ y = solars[!, "values"] T = length(y) steps_ahead = 168 -model = StructuralModel(y; freq_seasonal=24) +model = StructuralModel(y; freq_seasonal=168) fit!(model) prediction = StateSpaceLearning.forecast(model, steps_ahead) # arguments are the output of the fitted model and number of steps ahead the user wants to forecast diff --git a/src/estimation_procedure.jl b/src/estimation_procedure.jl index 8f2cc12..d3548da 100644 --- a/src/estimation_procedure.jl +++ b/src/estimation_procedure.jl @@ -294,7 +294,9 @@ function estimation_procedure( if hasintercept penalty_factor = ones(size(Estimation_X, 2) - 1) - penalty_factor[components_indexes["initial_states"][2:end] .- 1] .= 0 + if length(penalty_factor) != length(components_indexes["initial_states"][2:end]) + penalty_factor[components_indexes["initial_states"][2:end] .- 1] .= 0 + end coefs, _ = fit_lasso( Estimation_X, estimation_y, @@ -307,7 +309,9 @@ function estimation_procedure( ) else penalty_factor = ones(size(Estimation_X, 2)) - penalty_factor[components_indexes["initial_states"][1:end]] .= 0 + if length(penalty_factor) != length(components_indexes["initial_states"]) + penalty_factor[components_indexes["initial_states"][1:end]] .= 0 + end coefs, _ = fit_lasso( Estimation_X, estimation_y,