Learn R Programming

HDShOP (version 0.1.5)

CovarEstim: Covariance matrix estimator

Description

It is a function dispatcher for covariance matrix estimation. One can choose between traditional and shrinkage-based estimators.

Usage

CovarEstim(x, type = c("trad", "BGP14", "LW20"), ...)

Value

an object of class matrix

Arguments

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

Details

The available estimation methods are:

FunctionPaperType
Sigma_sample_estimatortraditional
CovShrinkBGP14Bodnar et al 2014BGP14
nonlin_shrinkLWLedoit & Wolf 2020LW20

Examples

Run this code
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")

Run the code above in your browser using DataLab