cstools {FoReco}R Documentation

Cross-sectional reconciliation tools

Description

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

Utilities: FoReco2matrix(), aggts(), 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)


[Package FoReco version 1.1.0 Index]