| teboot | R Documentation |
Joint block bootstrap for generating probabilistic base forecasts that take into account the correlation between different temporal aggregation orders (Girolimetto et al. 2023).
teboot(model_list, boot_size, agg_order, block_size = 1, seed = NULL,
xreg = NULL, ...)
model_list |
A list of all the |
boot_size |
The number of bootstrap replicates. |
agg_order |
Highest available sampling frequency per seasonal cycle
(max. order of temporal aggregation, |
block_size |
Block size of the bootstrap, which is typically equivalent to the forecast horizon for the most temporally aggregated series. |
seed |
An integer seed. |
xreg |
A ( |
... |
Additional arguments for the |
A (\text{boot\_size}\times (k^\ast+m)\text{block\_size}) matrix.
Girolimetto, D., Athanasopoulos, G., Di Fonzo, T. and Hyndman, R.J. (2024), Cross-temporal probabilistic forecast reconciliation: Methodological and practical issues. International Journal of Forecasting, 40, 3, 1134-1151. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.ijforecast.2023.10.003")}
Bootstrap samples:
csboot(),
ctboot()
Temporal framework:
tebu(),
tecov(),
telcc(),
temo(),
temvn(),
terec(),
tesmp(),
tetd(),
tetools()
set.seed(123)
# Minimal example functions: each "model" stores Gaussian residuals;
# simulate() draws new innovations (innov=NULL) or uses the supplied
# ones (innov given).
simple_model <- function(res) {
structure(list(residuals = res, sigma = sd(res)), class = "simple_model")
}
simulate.simple_model <- function(object, nsim = 1, innov = NULL,
future = TRUE, ...) {
if (is.null(innov)) {
rnorm(nsim, mean = 0, sd = object$sigma)
} else {
as.numeric(innov)[seq_len(nsim)]
}
}
# Temporal hierarchy: annual-quarterly, m = 4
# Aggregation orders k = 4, 2, 1 => k* + m = 1 + 2 + 4 = 7 models,
# ordered from the lowest frequency (annual) to the highest (quarterly).
m <- 4
kset <- c(4, 2, 1) # k = 4 (annual), 2 (semi), 1 (quarterly)
n_obs_per_k <- 40 / kset # residuals available at each frequency
model_list <- lapply(seq_along(kset), function(i) {
simple_model(rnorm(n_obs_per_k[i]))
})
# Joint block bootstrap: 100 replicates, block_size = 1 (one annual step)
boot <- teboot(model_list = model_list, boot_size = 100, agg_order = m,
block_size = 1, seed = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.