Description Usage Arguments Details Value Examples
View source: R/cov-estim-factor.R
Computes the AFM estimator of the covariance matrix.
1 2 3 4 5 6 7 | sigma_estim_afm(
data,
factors = NULL,
zeromean_log = FALSE,
resid_est_func,
...
)
|
data |
an nxp data matrix. |
factors |
a nxf matrix with factors. Default value is NULL and the factor is equal to the cross-sectional average of all the variables in the data. |
zeromean_log |
a logical, indicating whether the data matrix has zero means (TRUE) or not (FALSE). Default value is FALSE. |
resid_est_func |
a covariance estimation function, applied to the residuals covariance matrix. |
... |
further arguments to be parsed to resid_est_func |
The AFM covariance estimator is calculated with the following formula:
\hat{Σ} = B\hat{Σ}_F B' + \hat{Σ_u},
where \hat{Σ}_F is the sample covariance matrix of the common factors and \hat{Σ}_u is the residuals covariance matrix, estimated with the user-sapplied estim_func.
a list with the following entries
a pxp estimated covariance matrix.
an estimation specific tuning parameter, depending on the estimation function type.
1 2 3 4 5 6 | data(sp200)
sp_rets <- sp200[,-1]
sigma_afm <- sigma_estim_afm(sp_rets, resid_est_func=sigma_estim_lwnl)[[1]]
results_afm <- sigma_estim_afm(sp_rets, resid_est_func=sigma_estim_lwone, shrink_int=0.1)
sigma_afm <- results_afm[[1]]
param_afm <- results_afm[[2]]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.