View source: R/cov_estim_ewma.R
cov_estim_ewma | R Documentation |
Computes the Exponential Moving Average (EWMA) estimator of the covariance matrix.
cov_estim_ewma(data, lambda = 0.97)
data |
an nxp data matrix. |
lambda |
a double for the decay parameter |
The EWMA estimator of the covariance matrix for an nxp data matrix X is computed with the following formula:
\hat{\Sigma}_{t}= (1-\lambda)R_{t}R'_{t} + \lambda\hat{\Sigma}_{t-1},
where R_{t}
is the matrix of demeaned returns for the time period t
and
\hat{\Sigma}_{t-1}
is the EWMA covariance estimator for the period t-1
.
a list with the following entries
a pxp estimated covariance matrix.
an estimation specific tuning parameter, here the decay parameter \lambda
.
data(rets_m)
sigma_ewma <- cov_estim_ewma(rets_m)[[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.