# Evaluating estimate of covariance matrix

I am testing out different methods / shrinkages to estimate a covariance matrix and I am wondering what is the best method of comparing the estimated covariance matrix to the true covariance matrix (out of sample)? In other words, how can I assess the predictive power of the estimate?

For example, say I make a covariance matrix with data from the year 2022, and then I want to compare it with the actual covariance matrix for the first quarter of 2023, would Frobenius norm be appropriate? The goal of my test is to make a covariance matrix that can be used to forecast future volatility of a portfolio of assets.

Here is the code I am using (with just random data filled in), I used a LedoitWolf shrinkage estimator as an example:

import numpy as np
from sklearn.covariance import LedoitWolf

mu = 0.01
stdev = 0.003

actualdata = np.random.normal(loc = mu, scale = stdev, size=(10,13))
actualcov = np.cov(actualdata)

traindata = np.random.multivariate_normal(mean=mu*np.ones(10), cov = actualcov, size= 52)
traincov = LedoitWolf().fit(traindata).covariance_

error = np.linalg.norm(traincov - actualcov, "fro")


This error will be small of course because the train data is made from the real covariance matrix. My other idea was to create a backtest that tests whether using the covariance matrix in an mean variance portfolio is able to create a portfolio with lower variance out of sample than an equal weighted portfolio, ie. the covariance matrix must be effective to achieve that.

• What I have sometimes seen is a comparison between for example (1) the variance during 2023Q1 of a minimum variance portfolio with weights based on data prior to 31Dec2022, with (2) the (unachievable) variance during 2023Q1 of GMVP with weights based on the (retrospective) actual covariance matrix during 2023Q1. I am not sure if that is of interest to you or not. Oct 20, 2023 at 12:29