cscov {FoReco} | R Documentation |
Cross-sectional covariance matrix approximation
Description
This function provides an approximation of the cross-sectional base forecasts errors covariance matrix using different reconciliation methods (see Wickramasuriya et al., 2019 and Di Fonzo and Girolimetto, 2023).
Usage
cscov(comb = "ols", n = NULL, agg_mat = NULL, res, mse = TRUE,
shrink_fun = shrink_estim, ...)
Arguments
comb |
A string specifying the reconciliation method.
|
n |
Number of variables ( |
agg_mat |
A ( |
res |
An ( |
mse |
If |
shrink_fun |
Shrinkage function of the covariance matrix, shrink_estim (default). |
... |
Not used. |
Value
A (n \times n
) symmetric positive (semi-)definite matrix.
References
Ando, S., and Xiao, M. (2023), High-dimensional covariance matrix estimation: shrinkage toward a diagonal target. IMF Working Papers, 2023(257), A001.
Di Fonzo, T. and Girolimetto, D. (2023), Cross-temporal forecast reconciliation: Optimal combination method and heuristic alternatives, International Journal of Forecasting, 39, 1, 39-57. doi:10.1016/j.ijforecast.2021.08.004
Wickramasuriya, S.L., Athanasopoulos, G. and Hyndman, R.J. (2019), Optimal forecast reconciliation for hierarchical and grouped time series through trace minimization, Journal of the American Statistical Association, 114, 526, 804-819. doi:10.1080/01621459.2018.1448825
See Also
Cross-sectional framework:
csboot()
,
csbu()
,
cslcc()
,
csmo()
,
csrec()
,
cstd()
,
cstools()
Examples
# Aggregation matrix for Z = X + Y
A <- t(c(1,1))
# (10 x 3) in-sample residuals matrix (simulated)
res <- t(matrix(rnorm(n = 30), nrow = 3))
cov1 <- cscov("ols", n = 3) # OLS methods
cov2 <- cscov("str", agg_mat = A) # STR methods
cov3 <- cscov("wls", res = res) # WLS methods
cov4 <- cscov("shr", res = res) # SHR methods
cov5 <- cscov("sam", res = res) # SAM methods
# Custom covariance matrix
cscov.ols2 <- function(comb, x) diag(x)
cscov(comb = "ols2", x = 3) # == cscov("ols", n = 3)