FoReco (version 0.2.6)

hts_tools: Cross-sectional reconciliation tools

Description

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

Usage

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

Value

A list of five elements:

C

(n n_b) cross-sectional (contemporaneous) aggregation matrix.

S

(n n_b) cross-sectional (contemporaneous) summing matrix, S = [arrayc C
I_n_barray].

Ut

(n_a n) zero constraints cross-sectional (contemporaneous) kernel matrix. If the hierarchy admits a structural representation U' = [I \ -C]

n

Number of variables n_a + n_b.

na

Number of upper level variables.

nb

Number of bottom level variables.

Arguments

C

(n_a 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 (U'y = 0) spanning the null space valid for the reconciled forecasts. It can be used instead of parameter C, but nb is needed if U' [I \ -C]. If the hierarchy admits a structural representation, U' has dimension (n_a 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).

See Also

Other utilities: Cmatrix(), FoReco2ts(), agg_ts(), arrange_hres(), commat(), ctf_tools(), lcmat(), oct_bounds(), residuals_matrix(), score_index(), shrink_estim(), thf_tools()

Examples

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

Run the code above in your browser using DataLab