@@ -1376,6 +1376,8 @@ end
13761376 - `steps_ahead::Int`: Steps ahead.
13771377 - `punctual::Bool`: Flag for considering punctual forecast.
13781378 - `seasonal_innovation_simulation::Int`: Flag for considering seasonal innovation simulation.
1379+ - `N_scenarios::Int`: Number of scenarios to simulate.
1380+ - `simulate_outliers::Bool`: Flag for considering outliers simulation.
13791381
13801382 # Returns
13811383 - `Vector{AbstractFloat}`: Vector of states.
@@ -1386,6 +1388,7 @@ function simulate_states(
13861388 punctual:: Bool ,
13871389 seasonal_innovation_simulation:: Int ,
13881390 N_scenarios:: Int ,
1391+ simulate_outliers:: Bool ,
13891392):: Matrix{AbstractFloat}
13901393 T = length (model. y)
13911394
@@ -1659,7 +1662,7 @@ function simulate_states(
16591662 cycles_t = [zeros (N_scenarios) for _ in eachindex (model. cycle_period)]
16601663 end
16611664
1662- outlier_t = if (model. outlier && ! punctual)
1665+ outlier_t = if (simulate_outliers && model. outlier && ! punctual)
16631666 stochastic_outliers_set[t - T, :]
16641667 else
16651668 zeros (N_scenarios)
@@ -1764,7 +1767,7 @@ function forecast(
17641767 Exogenous_Forecast:: Matrix{Fl} = zeros (steps_ahead, 0 ),
17651768 dynamic_exog_coefs_forecasts:: Vector{<:Vector} = Vector {Vector} (undef, 0 ),
17661769):: Vector{AbstractFloat} where {Fl<: AbstractFloat }
1767- states_prediction = simulate_states (model, steps_ahead, true , 0 , 1 )[:, 1 ]
1770+ states_prediction = simulate_states (model, steps_ahead, true , 0 , 1 , false )[:, 1 ]
17681771
17691772 @assert size (Exogenous_Forecast, 1 ) == steps_ahead
17701773 @assert all (
@@ -1807,6 +1810,7 @@ end
18071810 - `Exogenous_Forecast::Matrix{Fl}`: Matrix of forecasts of exogenous variables.
18081811 - `dynamic_exog_coefs_forecasts::Vector{<:Vector}`: Vector of vectors of combination components forecasts.
18091812 - `seasonal_innovation_simulation::Int`: Number of seasonal innovation simulation.
1813+ - `simulate_outliers::Bool`: Flag to indicate whether to simulate outliers.
18101814 - `seed::Int`: Seed for the random number generator.
18111815
18121816 # Returns
@@ -1819,11 +1823,12 @@ function simulate(
18191823 Exogenous_Forecast:: Matrix{Fl} = zeros (steps_ahead, 0 ),
18201824 dynamic_exog_coefs_forecasts:: Vector{<:Vector} = Vector {Vector} (undef, 0 ),
18211825 seasonal_innovation_simulation:: Int = 0 ,
1826+ simulate_outliers:: Bool = true ,
18221827 seed:: Int = 1234 ,
18231828):: Matrix{AbstractFloat} where {Fl<: AbstractFloat }
18241829 Random. seed! (seed)
18251830 scenarios = simulate_states (
1826- model, steps_ahead, false , seasonal_innovation_simulation, N_scenarios
1831+ model, steps_ahead, false , seasonal_innovation_simulation, N_scenarios, simulate_outliers
18271832 )
18281833
18291834 dynamic_exog_coefs_prediction = forecast_dynamic_exog_coefs (
0 commit comments