iterec | R Documentation |
This function performs the iterative procedure described in Di Fonzo and Girolimetto (2023), which produces cross-temporally reconciled forecasts by alternating forecast reconciliation along one single dimension (either cross-sectional or temporal) at each iteration step.
iterec(base, cslist, telist, res = NULL, itmax = 100, tol = 1e-5,
type = "tcs", norm = "inf", verbose = TRUE)
base |
A ( |
cslist |
A list of elements for the cross-sectional reconciliation.
See csrec for a complete list (excluded |
telist |
A list of elements for the temporal reconciliation.
See terec for a complete list (excluded |
res |
A ( |
itmax |
Max number of iteration ( |
tol |
Convergence tolerance ( |
type |
A string specifying the uni-dimensional reconciliation order:
temporal and then cross-sectional (" |
norm |
Norm used to calculate the temporal and the cross-sectional
incoherence: infinity norm (" |
verbose |
If |
A (n \times h(k^\ast+m)
) numeric matrix of cross-temporal reconciled forecasts.
Di Fonzo, T. and Girolimetto, D. (2023), Cross-temporal forecast reconciliation: Optimal combination method and heuristic alternatives, International Journal of Forecasting, 39, 1, 39-57. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.ijforecast.2021.08.004")}
Cross-temporal framework:
ctboot()
,
ctbu()
,
ctcov()
,
ctlcc()
,
ctmo()
,
ctrec()
,
cttd()
,
cttools()
,
tcsrec()
set.seed(123)
# (3 x 7) base forecasts matrix (simulated), Z = X + Y and m = 4
base <- rbind(rnorm(7, rep(c(20, 10, 5), c(1, 2, 4))),
rnorm(7, rep(c(10, 5, 2.5), c(1, 2, 4))),
rnorm(7, rep(c(10, 5, 2.5), c(1, 2, 4))))
# (3 x 70) in-sample residuals matrix (simulated)
res <- rbind(rnorm(70), rnorm(70), rnorm(70))
A <- t(c(1,1)) # Aggregation matrix for Z = X + Y
m <- 4 # from quarterly to annual temporal aggregation
rite <- iterec(base = base,
cslist = list(agg_mat = A, comb = "shr"),
telist = list(agg_order = m, comb = "wlsv"),
res = res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.