estRMT: Denoising and detoning of Covariance matrix using Random...

Description Usage Arguments Details Author(s) Examples

View source: R/RMT.R

Description

Denoising and detoning of Covariance matrix using Random Matrix Theory

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
estRMT(
  R,
  Q = NA,
  cutoff = c("max", "each"),
  eigenTreat = c("average", "delete"),
  numEig = 1,
  parallel = TRUE,
  detone = FALSE,
  market_component = 1
)

Arguments

R

xts or matrix of asset returns with columns as return series

Q

ratio of rows/size. Can be supplied externally or fit using data

cutoff

takes two values max/each. If cutoff is max, Q is fitted and cutoff for eigenvalues is calculated. If cutoff is each, Q is set to row/size. Individual cutoff for each eigenvalue is calculated and used for filteration.

eigenTreat

takes 2 values, average/delete. If average then the noisy eigenvalues are averaged and each value is replaced by average. If delete then noisy eigenvalues are ignored and the diagonal entries of the correlation matrix are replaced with 1 to make the matrix psd.

numEig

number of eigenvalues that are known for variance calculation. Default is set to 1. If numEig = 0 then variance is assumed to be 1.

parallel

boolean to use all cores of a machine.

detone

boolean to detoning the correlation matrix of the market component, where the market component is assumed to be the eigenvector with the highest eigenvalue

market_component

the index of the market component in the eigenvectors and eigenvalues. Defaults to 1 as eigen function automatically ranks in descending order.

Details

This method takes in data as a matrix or an xts object. It then fits a marchenko pastur density to eigenvalues of the correlation matrix. All eigenvalues above the cutoff are retained and ones below the cutoff are replaced such that the trace of the correlation matrix is 1 or non-significant eigenvalues are deleted and diagonal of correlation matrix is changed to 1. Finally, correlation matrix is converted to covariance matrix.

Author(s)

Barry Quinn

Examples

1
2
3
4
5
## Not run: 
 data("largereturn")
 model <- estRMT(largesymdata, numEig = 0)

## End(Not run)

barryquinn1/ATI documentation built on May 10, 2021, 10:47 a.m.