FoReco (version 0.1.1)

hts_tools: Cross-sectional reconciliation tools

Description

Some useful tools for the cross-sectional reconciliation of linearly and hierarchically constrained time series

Usage

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

Arguments

C

(na x nb) cross-sectional (contemporaneous) matrix mapping the bottom level series into the higher level ones.

h

Forecast horizon (default is 1).

Ut

(na x n) zero constraints cross-sectional (contemporaneous) kernel matrix \(\textbf{U}'\textbf{Y} = \mathbf{0}_{\left[n_a \times (k^*+m)\right]}\) spanning the null space valid for the reconciled forecasts. It can be used instead of parameter C, but needs nb (n = na + nb).

nb

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

sparse

Option to return sparse object (default is TRUE).

Value

A list of five elements:

S

(n x nb) cross-sectional (contemporaneous) summing matrix.

Ut

(na x n) zero constraints cross-sectional (contemporaneous) kernel matrix.

n

Number of variables na + nb.

na

Number of upper level variables.

nb

Number of bottom level variables.

Examples

Run this code
# NOT RUN {
# 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