CovarEstim | R Documentation |
It is a function dispatcher for covariance matrix estimation. One can choose between traditional and shrinkage-based estimators.
CovarEstim(x, type = c("trad", "BGP14", "LW20"), ...)
x |
a p by n matrix or a data frame of asset returns. Rows represent different assets, columns – observations. |
type |
a character. The estimation method to be used. |
... |
arguments to pass to estimators |
The available estimation methods are:
Function | Paper | Type |
Sigma_sample_estimator | traditional | |
CovShrinkBGP14 | Bodnar et al 2014 | BGP14 |
nonlin_shrinkLW | Ledoit & Wolf 2020 | LW20 |
an object of class matrix
n<-3e2 # number of realizations
p<-.5*n # number of assets
x <- matrix(data = rnorm(n*p), nrow = p, ncol = n)
Mtrx_trad <- CovarEstim(x, type="trad")
TM <- matrix(0, p, p)
diag(TM) <- 1
Mtrx_bgp <- CovarEstim(x, type="BGP14", TM=TM)
Mtrx_lw <- CovarEstim(x, type="LW20")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.