Some useful tools for forecast reconciliation through temporal hierarchies.
thf_tools(m, h = 1, sparse = TRUE)Highest available sampling frequency per seasonal cycle (max. order of temporal aggregation, \(m\)), or a subset of the \(p\) factors of \(m\).
Forecast horizon for the lowest frequency (most temporally aggregated) time series (default is \(1\)).
Option to return sparse object (default is TRUE).
A list of seven elements:
KTemporal aggregation matrix.
RTemporal summing matrix.
ZtZero constraints temporal kernel matrix, \(\mathbf{Z}_h'\mathbf{Y}' = \mathbf{0}_{\left[hk^* \times n \right]}\).
ksetSet 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\).
mHighest available sampling frequency per seasonal cycle (max. order of temporal aggregation).
pNumber of elements of kset, \({\cal K}\).
ksSum of \(p-1\) factors of \(m\) (out of \(m\) itself), \(k^*\).
ktSum of all factors of m, \(k^{tot} = k^*+m\).
Other utilities:
Cmatrix(),
FoReco2ts(),
agg_ts(),
arrange_hres(),
commat(),
ctf_tools(),
hts_tools(),
lcmat(),
oct_bounds(),
residuals_matrix(),
score_index(),
shrink_estim()
# quarterly data
obj <- thf_tools(m = 4, sparse = FALSE)