From afbbd90dcd062af75d3ef4b01edc6d243d538edb Mon Sep 17 00:00:00 2001 From: andre_ramos Date: Wed, 30 Apr 2025 11:21:21 -0300 Subject: [PATCH 1/2] avoid simulating NaN residuals in residuals boostrapping --- Project.toml | 2 +- src/models/structural_model.jl | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 80f3404..422a93d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StateSpaceLearning" uuid = "971c4b7c-2c4e-4bac-8525-e842df3cde7b" authors = ["andreramosfc "] -version = "2.0.0" +version = "2.0.1" [deps] Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" diff --git a/src/models/structural_model.jl b/src/models/structural_model.jl index c973b36..cfd14d6 100644 --- a/src/models/structural_model.jl +++ b/src/models/structural_model.jl @@ -1465,13 +1465,11 @@ function simulate_states( start_idx = 1 final_idx = T outlier_values = model.output.components["o"]["Coefs"] - #stochastic_outliers_set = get_stochastic_values(outlier_values, steps_ahead, T, 1, T, seasonal_innovation_simulation) stochastic_outliers_set = rand(outlier_values, steps_ahead) end if !punctual - #stochastic_residuals_set = get_stochastic_values(model.output.ε, steps_ahead, T, 1, T, seasonal_innovation_simulation) - stochastic_residuals_set = rand(model.output.ε, steps_ahead) + stochastic_residuals_set = rand(model.output.ε[findall(i -> !isnan(i), model.output.ε)], steps_ahead) end for t in (T + 1):(T + steps_ahead) From ee616a0ad9d3ccf95229592cb0060b7c082d7be0 Mon Sep 17 00:00:00 2001 From: andre_ramos Date: Wed, 30 Apr 2025 11:25:15 -0300 Subject: [PATCH 2/2] fix blue format --- src/models/structural_model.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/models/structural_model.jl b/src/models/structural_model.jl index cfd14d6..4fe890c 100644 --- a/src/models/structural_model.jl +++ b/src/models/structural_model.jl @@ -1469,7 +1469,9 @@ function simulate_states( end if !punctual - stochastic_residuals_set = rand(model.output.ε[findall(i -> !isnan(i), model.output.ε)], steps_ahead) + stochastic_residuals_set = rand( + model.output.ε[findall(i -> !isnan(i), model.output.ε)], steps_ahead + ) end for t in (T + 1):(T + steps_ahead)