cstrec | R Documentation |
Cross-temporal forecast reconciliation according to the heuristic procedure by
Kourentzes and Athanasopoulos (2019), where the order of application of the
two reconciliation steps (temporal-first-then-cross-sectional, as in the function
tcsrec()
), is inverted. The function
cstrec()
performs cross-sectional reconciliation
(htsrec()
) first, then temporal reconciliation
(thfrec()
), and finally applies the average of the
projection matrices obtained in the second step to the one dimensional
reconciled values obtained in the first step.
cstrec(basef, hts_comb, thf_comb, res, ...)
basef |
(\mjseqnn \times h(k^\ast+m)) matrix of base forecasts to be reconciled, \mjseqn\widehat\mathbfY; \mjseqnn is the total number of variables, \mjseqnm is the highest time frequency, \mjseqnk^\ast is the sum of (a subset of) (\mjseqnp-1) factors of \mjseqnm, excluding \mjseqnm, and \mjseqnh is the forecast horizon for the lowest frequency time series. Each row identifies a time series, and the forecasts are ordered as [lowest_freq' ... highest_freq']'. |
hts_comb, thf_comb |
Type of covariance matrix (respectively
(\mjseqnn \times n) and (\mjseqn(k^\ast + m) \times (k^\ast + m))) to
be used in the cross-sectional and temporal reconciliation. More details in
|
res |
(\mjseqnn \times N(k^\ast + m)) matrix containing the residuals
at all the temporal frequencies ordered as [lowest_freq' ... highest_freq']'
(columns) for each variable (row), needed to estimate the covariance matrix
when |
... |
Any other options useful for |
Warning, the two-step heuristic reconciliation allows considering non negativity constraints only in the first step. This means that non-negativity is not guaranteed in the final reconciled values.
The function returns a list with two elements:
recf |
(\mjseqnn \times h(k^\ast + m)) reconciled forecasts matrix, \mjseqn\widetilde\mathbfY. |
M |
Matrix which transforms the uni-dimensional reconciled forecasts of step 1 (projection approach) . |
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.
Kourentzes, N., Athanasopoulos, G. (2019), Cross-temporal coherent forecasts for Australian tourism, Annals of Tourism Research, 75, 393-409.
Schäfer, J.L., Opgen-Rhein, R., Zuber, V., Ahdesmaki, M., Duarte Silva, A.P., Strimmer, K. (2017), Package ‘corpcor’, R package version 1.6.9 (April 1, 2017), https://CRAN.R-project.org/package= corpcor.
Schäfer, J.L., Strimmer, K. (2005), A Shrinkage Approach to Large-Scale Covariance Matrix Estimation and Implications for Functional Genomics, Statistical Applications in Genetics and Molecular Biology, 4, 1.
Stellato, B., Banjac, G., Goulart, P., Bemporad, A., Boyd, S. (2020). OSQP: An Operator Splitting Solver for Quadratic Programs, Mathematical Programming Computation, 12, 4, 637-672.
Stellato, B., Banjac, G., Goulart, P., Boyd, S., Anderson, E. (2019), OSQP: Quadratic Programming Solver using the 'OSQP' Library, R package version 0.6.0.3 (October 10, 2019), https://CRAN.R-project.org/package=osqp.
Other reconciliation procedures:
ctbu()
,
htsrec()
,
iterec()
,
lccrec()
,
octrec()
,
tcsrec()
,
tdrec()
,
thfrec()
data(FoReco_data)
obj <- cstrec(FoReco_data$base, m = 12, C = FoReco_data$C,
hts_comb = "shr", thf_comb = "acov", res = FoReco_data$res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.