Description Usage Arguments Value Author(s) References Examples
Function to calculate a statistical risk model (using principal component analysis). The code has been adapted from Kakushadze and Yu (2017).
1 | fit.statistical(retMat, use.cor = FALSE, erank = FALSE)
|
retMat |
matrix (or data.table/data.frame) of returns. Does not matter if the dates are in ascending or descending order. |
use.cor |
boolean to use correlation matrix instead of covariance matrix, default is FALSE |
erank |
boolean to use the effective rank instead of minimization algorithm, default is FALSE |
An object with S3 class "fir.factor.models" containing:
specific.risk is the vector idiosyncratic volatility (or specific risk),
factor.loadings is the matrix of loadings,
factor.cov is the matrix of factor covariances,
cov.mat is the matrix of variance/covariances,
inverse.cov is the inverse of the variance/covariance matrix,
princomp is the matrix of principal components (eigenvectors) of the fitted risk model,
dates is the vector of the dates used to estimate the risk model, and
id is the vector is ids representing the securities in the estimation universe.
Roger J. Bos, roger.bos@gmail.com
Kakushadze, Zura and Yu, Willie, Statistical Risk Models (February 14, 2016). The Journal of Investment Strategies 6(2) (2017) 1-40. Available at SSRN: https://ssrn.com/abstract=2732453
1 2 3 | retMat <- fit.data.cast(stock, item='RETURN', id.var = 'TICKER', date.var = 'DATE', reverse = TRUE)
fit <- fit.statistical(retMat)
names(fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.