quantlab.portfolio.approximate.estimate_all#

quantlab.portfolio.approximate.estimate_all(estimator, panel, volatility=None)[source]#

Estimate the covariance of one-bar returns at every bar of a decision panel.

Parameters:
estimatorCovarianceEstimator

The rule’s covariance estimator, a LedoitWolfEstimator or a FactorRiskStoreEstimator (implementation has checked it).

panelDecisionPanel

The bars’ decision inputs, their valuation prices (Ledoit-Wolf) or the risk model’s exposures and estimate rows (factor risk) included.

volatilitynp.ndarray, optional

[bars, symbols] one-bar volatilities in place of the historical ones (Ledoit-Wolf only); a symbol without a finite positive one is not covered.

Returns:
LowRankCovariance
Raises:
ValueError

If a factor risk panel has no exposures, or no estimate row at a bar (the message names the first such bar and the store’s range).

Examples

With risk a LedoitWolfEstimator over 20 bars and panel a decision panel of 2 bars over AAA, BBB and CCC, CCC listed too late for the window:

>>> estimate_all(risk, panel).covered
array([[ True,  True, False],
       [ True,  True, False]])