Description Usage Arguments Author(s) See Also Examples
View source: R/do_BBackTesting.R
This is a utility function used in the do.BBackTesting
function to define the rolling evaluation windows.
1 | build.scenarios(y, strategy = c(f = 20, h = 20, s = 2))
|
y |
Numerical vector indicating the years in input |
strategy |
Fitting-Forecasting strategy. Format: numerical vector.
The strategy |
Marius D. Pascariu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | y <- 1900:2016
# Strategy
S <- c(f = 20, h = 20, s = 1)
# This means that:
# - 20 years of data are used to fit the models;
# - forecast 20 years and evaluate the results;
# - roll the evaluation window 1 year and repeat the process.
# 78 scenarios are created using this years and strategy.
W <- build.scenarios(y, S)
W
# The first scenario will be:
W[[1, "fit"]]
W[[1, "forecast"]]
# The last scenario will be:
W[[78, "fit"]]
W[[78, "forecast"]]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.