Skip to content

Commit

Permalink
Merge caa6cac into 8855f2e
Browse files Browse the repository at this point in the history
  • Loading branch information
andreramosfdc authored Feb 7, 2025
2 parents 8855f2e + caa6cac commit c092a7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StateSpaceLearning"
uuid = "971c4b7c-2c4e-4bac-8525-e842df3cde7b"
authors = ["andreramosfc <andreramosfdc@gmail.com>"]
version = "1.3.1"
version = "1.3.2"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 6 additions & 2 deletions src/estimation_procedure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit c092a7d

Please sign in to comment.