hts_tools: Cross-sectional reconciliation tools

Description Usage Arguments Value See Also Examples

View source: R/hts_tools.R

Description

\loadmathjax

Some useful tools for the cross-sectional forecast reconciliation of a linearly constrained (e.g., hierarchical/grouped) multiple time series.

Usage

1
hts_tools(C, h = 1, Ut, nb, sparse = TRUE)

Arguments

C

(\mjseqnn_a \times n_b) cross-sectional (contemporaneous) matrix mapping the bottom level series into the higher level ones.

h

Forecast horizon (default is 1).

Ut

Zero constraints cross-sectional (contemporaneous) kernel matrix \mjseqn(\mathbfU'\mathbfy = \mathbf0) spanning the null space valid for the reconciled forecasts. It can be used instead of parameter C, but nb is needed if \mjseqn\mathbfU' \neq [\mathbfI \ -\mathbfC]. If the hierarchy admits a structural representation, \mjseqn\mathbfU' has dimension (\mjseqnn_a \times n).

nb

Number of bottom time series; if C is present, nb and Ut are not used.

sparse

Option to return sparse matrices (default is TRUE).

Value

A list of five elements:

C

(\mjseqnn \times n_b) cross-sectional (contemporaneous) aggregation matrix.

S

(\mjseqnn \times n_b) cross-sectional (contemporaneous) summing matrix, \mjseqn\mathbfS = \left[\beginarrayc \mathbfC
\mathbfI_n_b\endarray\right].

Ut

(\mjseqnn_a \times n) zero constraints cross-sectional (contemporaneous) kernel matrix. If the hierarchy admits a structural representation \mjseqn\mathbfU' = [\mathbfI \ -\mathbfC]

n

Number of variables \mjseqnn_a + n_b.

na

Number of upper level variables.

nb

Number of bottom level variables.

See Also

Other utilities: Cmatrix(), FoReco2ts(), commat(), ctf_tools(), oct_bounds(), score_index(), shrink_estim(), srref(), thf_tools(), ut2c()

Examples

1
2
# One level hierarchy (na = 1, nb = 2)
obj <- hts_tools(C = matrix(c(1, 1), 1), sparse = FALSE)

FoReco documentation built on July 23, 2021, 5:06 p.m.