Ledoit-Wolf Constant Correlation Shrinkage

The Ledoit-Wolf Constant Correlation Shrinkage pulls the sample covariance towards the matrix that keeps every sample variance and sets every correlation to the average sample correlation (Ledoit and Wolf, 2004, “Honey, I Shrunk the Sample Covariance Matrix”). The target keeps each asset’s own variance and the general level of co-movement, so only the differences between the correlations, which are mostly noise, are shrunk.

The formula for the Ledoit-Wolf Constant Correlation Shrinkage starts from the sample covariance S of the demeaned returns \(y_{i , t}\) of the N assets over the T periods, divided by T, its correlations \(R_{i , j}\) and their average \(r_{\text{avg}}\) off the diagonal:

\[S_{i,j} = \frac{\sum_{t=1}^{T} y_{i,t} \cdot y_{j,t}}{T}\] \[r_{\text{avg}} = \frac{\sum_{i=1}^{N} \sum_{j=1}^{N} R_{i,j} - N}{N \cdot (N - 1)}\]

The target F keeps the variances and gives every pair the average correlation:

\[F_{i,i} = S_{i,i}\] \[F_{i,j} = r_{\text{avg}} \cdot \sqrt{S_{i,i} \cdot S_{j,j}} \quad \text{if } i \neq j\]

The intensity follows from the variances \(\pi_{i , j}\) of the entries of S, their covariances \(\theta_{i , j}\) with the sample variances, the covariance rho of the target with S, and the squared distance gamma between the target and S:

\[\pi_{i,j} = \frac{\sum_{t=1}^{T} (y_{i,t} \cdot y_{j,t} - S_{i,j})^{2}}{T}\] \[\theta_{i,j} = \frac{\sum_{t=1}^{T} \left(y_{i,t}^{2} - S_{i,i}\right) \cdot (y_{i,t} \cdot y_{j,t} - S_{i,j})}{T} \quad \text{if } i \neq j\] \[\theta_{i,i} = 0\] \[\rho = \sum_{i=1}^{N} \pi_{i,i} + r_{\text{avg}} \cdot \sum_{i=1}^{N} \sum_{j=1}^{N} \sqrt{\frac{S_{j,j}}{S_{i,i}}} \cdot \theta_{i,j}\] \[\gamma = \sum_{i=1}^{N} \sum_{j=1}^{N} (F_{i,j} - S_{i,j})^{2}\] \[\delta = \max\left(0, \min\left(\frac{\sum_{i=1}^{N} \sum_{j=1}^{N} \pi_{i,j} - \rho}{\gamma \cdot T}, 1\right)\right)\]

The estimate moves S that share of the way to the target:

\[\Sigma = (1 - \delta) \cdot S + \delta \cdot F\]

It suits stocks, whose correlations share a common level that the identity target of the Ledoit-Wolf Shrinkage ignores; it keeps the variances of the sample covariance.

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: constant correlation model, Honey I Shrunk the Sample Covariance Matrix.

In the Finance Toolkit this is get_covariance_estimate with method="ledoit_wolf_constant_correlation", 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="ledoit_wolf_constant_correlation")

Which returns:

References

  • Paper Ledoit, O. and Wolf, M. (2004). “Honey, I Shrunk the Sample Covariance Matrix.” The Journal of Portfolio Management, 30(4), 110-119.
  • Library Shares similar logic as PyPortfolioOpt’s CovarianceShrinkage.ledoit_wolf (Ledoit-Wolf Shrinkage, Ledoit-Wolf Constant Correlation Shrinkage, Ledoit-Wolf Single Factor Shrinkage)
Share