fit.statistical: fit.statistical

Description Usage Arguments Value Author(s) References Examples

Description

Function to calculate a statistical risk model (using principal component analysis). The code has been adapted from Kakushadze and Yu (2017).

Usage

1
fit.statistical(retMat, use.cor = FALSE, erank = FALSE)

Arguments

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

Value

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.

Author(s)

Roger J. Bos, roger.bos@gmail.com

References

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

Examples

1
2
3
retMat <- fit.data.cast(stock, item='RETURN', id.var = 'TICKER', date.var = 'DATE', reverse = TRUE)
fit <- fit.statistical(retMat)
names(fit)

rogerjbos/fit.factor.models documentation built on July 23, 2020, 3:44 p.m.