quantlab.portfolio.predefined.approximate.covariance.factor_risk#
- quantlab.portfolio.predefined.approximate.covariance.factor_risk(config, panel, volatility=None)[source]#
Every bar’s factor risk forecast,
B F B' + diag(D)per bar, with array operations over all bars.Bis the model’sexposure_matrixof every bar’s exposures on the panel’s symbols (one call over all bars),Fthe estimate rows’ factor covariance andDthe squared specific risks, on the model’s factors in their order, so every bar shares one factor axis. The coverage is a simplified version ofFactorRiskModel.forecast’s:a factor is kept at a bar when its variance there is finite; a dropped factor has zero exposures and a zero row and column of
F, and a symbol exposed to it is not covered there, as inforecast;a missing covariance between two kept factors is taken as 0, where
forecastdrops factors (covered_factors) until the block is finite, and leaves out the symbols exposed to them;a symbol is covered when
exposure_matrixcovers it and it has a finite specific risk and finite exposures on the kept factors, as inforecast.
A bar the estimate store has no row at is refused, as the per-bar estimator refuses it.
volatilityis refused: the optimiser refusesvolatility_labelwith a factor risk model when it is constructed.