| ctbu | R Documentation |
Cross-temporal bottom-up reconciled forecasts for all series at any temporal
aggregation level are computed by appropriate summation of the high-frequency
bottom base forecasts \widehat{\mathbf{B}^{[1]}}:
\widetilde{\mathbf{X}} = \mathbf{S}_{cs}\widehat{\mathbf{B}^{[1]}}\mathbf{S}'_{te},
where \mathbf{S}_{cs} and \mathbf{S}_{te} are the cross-sectional and
temporal structural matrices, respectively.
ctbu(base, agg_mat, agg_order, tew = "sum", sntz = FALSE)
base |
A ( |
agg_mat |
A ( |
agg_order |
Highest available sampling frequency per seasonal cycle (max. order
of temporal aggregation, |
tew |
A string specifying the type of temporal aggregation. Options include:
" |
sntz |
If |
A (n \times h(k^\ast+m)) numeric matrix of cross-temporal reconciled forecasts.
Bottom-up reconciliation:
csbu(),
tebu()
Cross-temporal framework:
ctboot(),
ctcov(),
ctlcc(),
ctmo(),
ctrec(),
cttd(),
cttools(),
iterec(),
tcsrec()
set.seed(123)
# Aggregation matrix for Z = X + Y
A <- t(c(1,1))
# (2 x 4) high frequency bottom base forecasts matrix (simulated),
# agg_order = 4 (annual-quarterly)
hfbts <- matrix(rnorm(4*2, 2.5), 2, 4)
reco <- ctbu(base = hfbts, agg_mat = A, agg_order = 4)
# Non negative reconciliation
hfbts[1,4] <- -hfbts[1,4] # Making negative one of the quarterly base forecasts for variable X
nnreco <- ctbu(base = hfbts, agg_mat = A, agg_order = 4, sntz = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.