Some useful tools for forecast reconciliation through temporal hierarchies.

thf_tools(m, h = 1, sparse = TRUE)

Arguments

m

Highest available sampling frequency per seasonal cycle (max. order of temporal aggregation, \(m\)), or a subset of the \(p\) factors of \(m\).

h

Forecast horizon for the lowest frequency (most temporally aggregated) time series (default is \(1\)).

sparse

Option to return sparse object (default is TRUE).

Value

A list of seven elements:

K

Temporal aggregation matrix.

R

Temporal summing matrix.

Zt

Zero constraints temporal kernel matrix, \(\mathbf{Z}_h'\mathbf{Y}' = \mathbf{0}_{\left[hk^* \times n \right]}\).

kset

Set of factors (\(p\)) of \(m\) in descending order (from \(m\) to 1), \({\cal K} = \left\lbrace k_p, k_{p-1}, \ldots, k_2, k_1\right\rbrace\), \(k_p=m\), \(k_1=1\).

m

Highest available sampling frequency per seasonal cycle (max. order of temporal aggregation).

p

Number of elements of kset, \({\cal K}\).

ks

Sum of \(p-1\) factors of \(m\) (out of \(m\) itself), \(k^*\).

kt

Sum of all factors of m, \(k^{tot} = k^*+m\).

Examples

# quarterly data
obj <- thf_tools(m = 4, sparse = FALSE)