Sigma_sample_estimator {HDShOP}R Documentation

Sample covariance matrix

Description

It computes the sample covariance of matrix S as follows:

S = \frac{1}{n-1} \sum_{j=1}^n (x_j - \bar x)(x_j - \bar x)' ,\quad \bar x = \frac{1}{n} \sum_{j=1}^n x_j ,

where x_j is the j-th column of the data matrix x.

Usage

Sigma_sample_estimator(x)

Arguments

x

a p by n matrix or a data frame of asset returns. Rows represent different assets, columns – observations.

Value

Sample covariance estimation

Examples

p<-5 # number of assets
n<-1e1 # number of realizations

x <-matrix(data = rnorm(n*p), nrow = p, ncol = n)
Sigma_sample_estimator(x)

[Package HDShOP version 0.1.5 Index]