From 84150a5135228300b23401ffc620d4bb301a904a Mon Sep 17 00:00:00 2001 From: guilhermebodin Date: Wed, 18 May 2022 18:56:04 -0300 Subject: [PATCH] Adjust simulation window --- Project.toml | 2 +- src/simulate.jl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 4e30100..102a27b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ScoreDrivenModels" uuid = "4a87933e-d659-11e9-0e65-7f40dedd4a3a" authors = ["guilhermebodin , raphaelsaavedra "] -version = "0.1.10" +version = "0.1.11" [deps] Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" diff --git a/src/simulate.jl b/src/simulate.jl index f846558..b93ac38 100644 --- a/src/simulate.jl +++ b/src/simulate.jl @@ -31,12 +31,12 @@ function simulate(series::Vector{T}, gas::Model{D, T}, H::Int, S::Int; parameter_scenarios = Array{T, 3}(undef, H, n_params, S) for scenario in 1:S # Notice that we know the parameter time_varying parameters for T + 1 - # So the last initial_params is already a part of the future simulation - # And we must take the + # So the last initial_params is already a part of the future simulation. + # When we simulate 60 steps ahead the last observation is one too much for us. sim, param = simulate_recursion(gas, H + biggest_lag; initial_params = params_simulation) - observation_scenarios[:, scenario] = sim[biggest_lag+1:end] + observation_scenarios[:, scenario] = sim[biggest_lag:end-1] # The first param is known - parameter_scenarios[:, :, scenario] = param[biggest_lag+1:end, :] + parameter_scenarios[:, :, scenario] = param[biggest_lag:end-1, :] end return observation_scenarios, parameter_scenarios end