Skip to content

Commit

Permalink
Update get_predictions.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Nov 28, 2024
1 parent 6ae9e5f commit 96973a4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions examples/get_predictions.jl
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
# In this tutorial we illustrate how to get predictions from the model for a number of quarters starting from previous simulations.
# In this tutorial we illustrate how to get predictions from the model for
# a number of quarters starting from previous simulations.

using BeforeIT, FileIO
using Dates

year_ = 2010
number_years = 9#10
number_years = 9
number_quarters = 4 * number_years
horizon = 12#12
horizon = 12
number_seeds = 4
number_sectors = 62

# Load the real time series
data = BeforeIT.ITALY_CALIBRATION.data


quarters_num = []
year_m = year_
for month in 4:3:((number_years + 1) * 12 + 1)

year_m = year_ + (month ÷ 12)
mont_m = month % 12
date = DateTime(year_m, mont_m, 1) - Day(1)

push!(quarters_num, BeforeIT.date2num(date))
end

for i in 1:number_quarters

quarter_num = quarters_num[i]

BeforeIT.get_predictions_from_sims(data, quarter_num, horizon, number_seeds)

end

0 comments on commit 96973a4

Please sign in to comment.