watex.analysis.LW_score#

watex.analysis.LW_score(X, store_precision=True, assume_centered=False, **kws)[source]#

Models score from Ledoit-Wolf.

Parameters
  • store_precision (bool, default=True) – Specify if the estimated precision is stored.

  • assume_centered (bool, default=False) – If True, data will not be centered before computation. Useful when working with data whose mean is almost, but not exactly zero. If False (default), data will be centered before computation.

  • block_size (int, default=1000) – Size of blocks into which the covariance matrix will be split during its Ledoit-Wolf estimation. This is purely a memory optimization and does not affect results.

Notes

The regularised covariance is:

\[(1 - text{shrinkage}) * \text{cov} + \text{shrinkage} * \mu * \text{np.identity(n_features)}\]

where \(\mu = \text{trace(cov)} / n_{features}\) and shrinkage is given by the Ledoit and Wolf formula

References

“A Well-Conditioned Estimator for Large-Dimensional Covariance Matrices”, Ledoit and Wolf, Journal of Multivariate Analysis, Volume 88, Issue 2, February 2004, pages 365-411.