Skip to content

Commit c458ed0

Browse files
Merge pull request #79 from LAMPSPUC/fix_simulation_no_slope
fix simulation for model with level and without slope
2 parents 398387b + cba2be3 commit c458ed0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StateSpaceLearning"
22
uuid = "971c4b7c-2c4e-4bac-8525-e842df3cde7b"
33
authors = ["andreramosfc <[email protected]>"]
4-
version = "2.0.9"
4+
version = "2.0.10"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"

src/models/structural_model.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ mutable struct StructuralModel <: StateSpaceLearningModel
9595

9696
@assert !has_intercept(exog) "Exogenous matrix must not have an intercept column"
9797
@assert 1 <= stochastic_start < length(y) "stochastic_start must be greater than or equal to 1 and smaller than the length of the time series"
98-
@assert level in ["deterministic", "stochastic", "none"] "level must be either deterministic, stochastic or no"
99-
@assert slope in ["deterministic", "stochastic", "none"] "slope must be either deterministic, stochastic or no"
100-
@assert seasonal in ["deterministic", "stochastic", "none"] "seasonal must be either deterministic, stochastic or no"
101-
@assert cycle in ["deterministic", "stochastic", "none"] "cycle must be either deterministic, stochastic or no"
98+
@assert level in ["deterministic", "stochastic", "none"] "level must be either deterministic, stochastic or none"
99+
@assert slope in ["deterministic", "stochastic", "none"] "slope must be either deterministic, stochastic or none"
100+
@assert seasonal in ["deterministic", "stochastic", "none"] "seasonal must be either deterministic, stochastic or none"
101+
@assert cycle in ["deterministic", "stochastic", "none"] "cycle must be either deterministic, stochastic or none"
102102
@assert seasonal != "none" ? length(y) > minimum(freq_seasonal) : true "Time series must be longer than the seasonal period if seasonal is added"
103103

104104
if typeof(freq_seasonal) <: Vector
@@ -1591,7 +1591,7 @@ function simulate_states(
15911591
)
15921592
end
15931593

1594-
model.slope ? slope = ones(T, N_scenarios) .* slope : nothing
1594+
slope = ones(T, N_scenarios) .* slope
15951595
model.level ? trend = ones(T, N_scenarios) .* trend : nothing
15961596
model.seasonal ? seasonals = [ones(T, N_scenarios) .* s for s in seasonals] : nothing
15971597
for t in (T + 1):(T + steps_ahead)

0 commit comments

Comments
 (0)