Skip to contents

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

Usage

cstools(agg_mat, cons_mat, sparse = TRUE)

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. It spans the null space for the reconciled forecasts.

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(), csrec(), cstd()

Utilities: FoReco2matrix(), aggts(), balance_hierarchy(), commat(), csprojmat(), ctprojmat(), cttools(), df2aggmat(), lcmat(), recoinfo(), res2matrix(), shrink_estim(), teprojmat(), tetools(), unbalance_hierarchy()

Examples

# Cross-sectional framework
# One level hierarchy A = [1 1]
A <- matrix(1, 1, 2)
obj <- cstools(agg_mat = A)