The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing an MSE
criterion), yielding the Ledoit-Wolf covariance estimate.
Chen et al. [1] proposed an improvement of the Ledoit-Wolf shrinkage
parameter, the OAS coefficient, whose convergence is significantly
better under the assumption that the data are Gaussian.
This example, inspired from Chen’s publication [1], shows a comparison
of the estimated MSE of the LW and OAS methods, using Gaussian
distributed data.
References
# Authors: The scikit-learn developers# SPDX-License-Identifier: BSD-3-Clauseimportmatplotlib.pyplotaspltimportnumpyasnpfromscipy.linalgimportcholesky,toeplitzfromsklearn.covarianceimportOAS,LedoitWolfnp.random.seed(0)