Sigma_sample_estimator | R Documentation |
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
.
Sigma_sample_estimator(x)
x |
a p by n matrix or a data frame of asset returns. Rows represent different assets, columns – observations. |
Sample covariance estimation
p<-5 # number of assets
n<-1e1 # number of realizations
x <-matrix(data = rnorm(n*p), nrow = p, ncol = n)
Sigma_sample_estimator(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.