Projection matrix for optimal combination cross-sectional reconciliation
Projection matrix for optimal combination cross-sectional reconciliation
This function computes the projection or the mapping matrix M and G, respectively, such that y=My=ScsGy, where y is the vector of the reconciled forecasts, y is the vector of the base forecasts, Scs is the cross-sectional structural matrix, and M=ScsG. For further information regarding on the structure of these matrices, refer to Girolimetto et al. (2023).
csprojmat(agg_mat, cons_mat, comb ="ols", res =NULL, mat ="M",...)
Arguments
agg_mat: A (na×nb) numeric matrix representing the cross-sectional aggregation matrix. It maps the nb bottom-level (free) variables into the na upper (constrained) variables.
cons_mat: A (na×n) numeric matrix representing the cross-sectional zero constraints. It spans the null space for the reconciled forecasts.
comb: A string specifying the reconciliation method. For a complete list, see cscov .
res: An (N×n) optional numeric matrix containing the in-sample residuals. This matrix is used to compute some covariance matrices.
mat: A string specifying which matrix to return: "M" (default) for M and "G" for G.
...: Arguments passed on to cscov
mse: If TRUE (default) the residuals used to compute the covariance matrix are not mean-corrected.
shrink_fun: Shrinkage function of the covariance matrix, shrink_estim (default).
Returns
The projection matrix M (mat = "M") or the mapping matrix G (mat = "G").
Examples
# Cross-sectional frameworkA <- t(c(1,1))# Aggregation matrix for Z = X + YMcs <- csprojmat(agg_mat = A, comb ="ols")Gcs <- csprojmat(agg_mat = A, comb ="ols", mat ="G")
References
Girolimetto, D., Athanasopoulos, G., Di Fonzo, T. and Hyndman, R.J. (2024), Cross-temporal probabilistic forecast reconciliation: Methodological and practical issues. International Journal of Forecasting, 40, 3, 1134-1151. tools:::Rd_expr_doi("10.1016/j.ijforecast.2023.10.003")