@@ -1376,6 +1376,8 @@ end
1376
1376
- `steps_ahead::Int`: Steps ahead.
1377
1377
- `punctual::Bool`: Flag for considering punctual forecast.
1378
1378
- `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.
1379
1381
1380
1382
# Returns
1381
1383
- `Vector{AbstractFloat}`: Vector of states.
@@ -1386,6 +1388,7 @@ function simulate_states(
1386
1388
punctual:: Bool ,
1387
1389
seasonal_innovation_simulation:: Int ,
1388
1390
N_scenarios:: Int ,
1391
+ simulate_outliers:: Bool ,
1389
1392
):: Matrix{AbstractFloat}
1390
1393
T = length (model. y)
1391
1394
@@ -1659,7 +1662,7 @@ function simulate_states(
1659
1662
cycles_t = [zeros (N_scenarios) for _ in eachindex (model. cycle_period)]
1660
1663
end
1661
1664
1662
- outlier_t = if (model. outlier && ! punctual)
1665
+ outlier_t = if (simulate_outliers && model. outlier && ! punctual)
1663
1666
stochastic_outliers_set[t - T, :]
1664
1667
else
1665
1668
zeros (N_scenarios)
@@ -1764,7 +1767,7 @@ function forecast(
1764
1767
Exogenous_Forecast:: Matrix{Fl} = zeros (steps_ahead, 0 ),
1765
1768
dynamic_exog_coefs_forecasts:: Vector{<:Vector} = Vector {Vector} (undef, 0 ),
1766
1769
):: 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 ]
1768
1771
1769
1772
@assert size (Exogenous_Forecast, 1 ) == steps_ahead
1770
1773
@assert all (
@@ -1807,6 +1810,7 @@ end
1807
1810
- `Exogenous_Forecast::Matrix{Fl}`: Matrix of forecasts of exogenous variables.
1808
1811
- `dynamic_exog_coefs_forecasts::Vector{<:Vector}`: Vector of vectors of combination components forecasts.
1809
1812
- `seasonal_innovation_simulation::Int`: Number of seasonal innovation simulation.
1813
+ - `simulate_outliers::Bool`: Flag to indicate whether to simulate outliers.
1810
1814
- `seed::Int`: Seed for the random number generator.
1811
1815
1812
1816
# Returns
@@ -1819,11 +1823,12 @@ function simulate(
1819
1823
Exogenous_Forecast:: Matrix{Fl} = zeros (steps_ahead, 0 ),
1820
1824
dynamic_exog_coefs_forecasts:: Vector{<:Vector} = Vector {Vector} (undef, 0 ),
1821
1825
seasonal_innovation_simulation:: Int = 0 ,
1826
+ simulate_outliers:: Bool = true ,
1822
1827
seed:: Int = 1234 ,
1823
1828
):: Matrix{AbstractFloat} where {Fl<: AbstractFloat }
1824
1829
Random. seed! (seed)
1825
1830
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
1827
1832
)
1828
1833
1829
1834
dynamic_exog_coefs_prediction = forecast_dynamic_exog_coefs (
0 commit comments