Nonparametric Eigenvalue-Regularized Covariance Matrix Estimator

The Nonparametric Eigenvalue-Regularized Covariance Matrix Estimator (NERCOME) takes the eigenvectors from one part of the periods and the variances along them from the other, so the eigenvalues are not fitted to the same noise as the eigenvectors (Abadir, Distaso and Žikeš, 2014; Lam, 2016). The sample covariance overstates its largest eigenvalues and understates its smallest because both come from the same periods.

The formula for the Nonparametric Eigenvalue-Regularized Covariance Matrix Estimator splits the periods, in a random order, into a first part of m periods with sample covariance \(S_{1}\) and eigenvectors \(P_{1}\) and the rest with sample covariance \(S_{2}\) (both ddof=1), and keeps the eigenvectors of the first part with the variances the second shows along them, with Diag the diagonal of a matrix:

\[\Sigma_{s} = P_{1} \cdot \text{Diag}(P'_{1} \cdot S_{2} \cdot P_{1}) \cdot P'_{1}\]

It averages that estimate over \(M = 50\) random splits:

\[\Sigma = \frac{\sum_{s=1}^{M} \Sigma_{s}}{M}\]

The split m is the one of a few candidates whose estimates lie closest to the second parts’ sample covariances (Lam, 2016). The estimate shrinks the extreme eigenvalues without a model or a target.

Its parameters can be set, and it can be shown as a correlation matrix. The covariance matrix holds the variance of every asset and the covariance of every pair, the risk input of the mean-variance analysis of Markowitz (1952). With N assets it holds N (N + 1) / 2 numbers to estimate, and when N is not small compared to the number of periods T, the sample estimate is noisy and ill-conditioned: its smallest eigenvalues come out too small, and an optimizer that inverts it puts large weights on the combinations of assets that only look safe in the sample. The estimators differ in how they deal with this: by shrinking towards a structured target, by cleaning the eigenvalues, by weighting recent periods, by counting only large moves or by resisting outliers. Every estimate is annualized with the number of periods in a year.

Also known as: NERCOME, split-sample covariance.

In the Finance Toolkit this is get_covariance_estimate with method="nercome", the same function as Covariance Estimate.

Example · AAPL, MSFT, JNJ, XOM · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_covariance_estimate:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AAPL", "MSFT", "JNJ", "XOM"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.portfolio.get_covariance_estimate(method="nercome")

Which returns:

References

  • Paper Abadir, K. M., Distaso, W. and Žikeš, F. (2014). “Design-Free Estimation of Variance Matrices.” Journal of Econometrics, 181(2), 165-180.
  • Paper Lam, C. (2016). “Nonparametric Eigenvalue-Regularized Precision or Covariance Matrix Estimator.” The Annals of Statistics, 44(3), 928-953.
  • Library Shares similar logic as RiskLabAI’s nercome_denoised_covariance (Nonparametric Eigenvalue-Regularized Covariance Matrix Estimator)
Share