Some useful tools for the cross-sectional forecast reconciliation of a linearly constrained (e.g., hierarchical/grouped) multiple time series.
Arguments
- agg_mat
A (\(n_a \times n_b\)) numeric matrix representing the cross-sectional aggregation matrix. It maps the \(n_b\) bottom-level (free) variables into the \(n_a\) upper (constrained) variables.
- cons_mat
A (\(n_a \times n\)) numeric matrix representing the cross-sectional zero constraints: each row represents a constraint equation, and each column represents a variable. The matrix can be of full rank, meaning the rows are linearly independent, but this is not a strict requirement, as the function allows for redundancy in the constraints.
- sparse
Option to return sparse matrices (default is
TRUE).
Value
A list with four elements:
- dim
A vector containing information about the number of series for the complete system (
n), for upper levels (na) and bottom level (nb).- agg_mat
The cross-sectional aggregation matrix.
- strc_mat
The cross-sectional structural matrix.
- cons_mat
The cross-sectional zero constraints matrix.
See also
Cross-sectional framework:
csboot(),
csbu(),
cscov(),
cslcc(),
csmo(),
csmvn(),
csrec(),
cssmp(),
cstd()
Utilities:
FoReco2matrix(),
aggts(),
as_ctmatrix(),
as_tevector(),
balance_hierarchy(),
commat(),
csprojmat(),
ctprojmat(),
cttools(),
df2aggmat(),
lcmat(),
recoinfo(),
res2matrix(),
set_bounds(),
shrink_estim(),
shrink_oasd(),
teprojmat(),
tetools(),
unbalance_hierarchy()
Examples
# Cross-sectional framework
# One level hierarchy A = [1 1]
A <- matrix(1, 1, 2)
obj <- cstools(agg_mat = A)