Shrinkage of the covariance matrix according to the Oracle Approximating
Shrinkage (OAS) of Chen et al. (2009) and Ando and Xiao (2023).
Usage
shrink_oasd(x, mse = TRUE)
Arguments
- x
A numeric matrix containing the in-sample residuals or validation
errors.
- mse
If TRUE (default), the residuals used to compute the
covariance matrix are not mean-corrected.
Value
A shrunk covariance matrix.
References
Ando, S., and Xiao, M. (2023), High-dimensional covariance matrix estimation:
shrinkage toward a diagonal target. IMF Working Papers, 2023(257),
A001.
Chen, Y., Wiesel, A., and Hero, A. O. (2009), Shrinkage estimation of high
dimensional covariance matrices, 2009 IEEE international conference on
acoustics, speech and signal processing, 2937–2940. IEEE.
See also
Utilities:
aggts(),
as_ctmatrix(),
as_tevector(),
balance_hierarchy(),
commat(),
csprojmat(),
cstools(),
ctprojmat(),
cttools(),
df2aggmat(),
lcmat(),
res2matrix(),
set_bounds(),
shrink_estim(),
teprojmat(),
tetools(),
unbalance_hierarchy()
Examples
set.seed(123)
# Simulated in-sample residuals: 50 observations of a 4-variate process
res <- matrix(rnorm(50 * 4), nrow = 50, ncol = 4)
# Oracle Approximating Shrinkage (OAS) covariance matrix
shr <- shrink_oasd(res)
# Shrinkage intensity selected by the procedure
attr(shr, "lambda")
#> [1] 1