quantlab.portfolio.predefined.approximate.covariance.ledoit_wolf#
- quantlab.portfolio.predefined.approximate.covariance.ledoit_wolf(config, panel, volatility=None)[source]#
Every bar’s Ledoit-Wolf estimate, as
LedoitWolfEstimator.estimategives it on the bar’s context.The same coverage rule (every return of the window finite, not all equal, staleness within
max_stale_bars, and withvolatilitya finite positive one), on the bar’s return window and staleness as the panel gives them;a I + U U'withathe shrinkage coefficient times the mean variance andUthe covered symbols’ demeaned window scaled bysqrt((1 - shrinkage) / lookback_bars). The bars are read in batches, so the windows held at once stay bounded. Withvolatilitythe covered symbols’ volatilities are replaced (LowRankCovariance.with_volatility).