# Estimating correlation and covariance matrices by weighting of market similarity

###### Abstract

We discuss a weighted estimation of correlation and covariance matrices from historical financial data. To this end, we introduce a weighting scheme that accounts for similarity of previous market conditions to the present one. The resulting estimators are less biased and show lower variance than either unweighted or exponentially weighted estimators.

The weighting scheme is based on a similarity measure which compares the current correlation structure of the market to the structures at past times. Similarity is then measured by the matrix 2-norm of the difference of probe correlation matrices estimated for two different times. The method is validated in a simulation study and tested empirically in the context of mean-variance portfolio optimization. In the latter case we find an enhanced realized portfolio return as well as a reduced portfolio volatility compared to alternative approaches based on different strategies and estimators.

## I Introduction

Good estimates of the correlation and covariance matrices of financial returns are central for a wide range of applications such as risk management, option pricing, hedging and capital allocation. For example in risk management applications, they directly affect the calculation of the value at risk or the expected shortfall. In the context of capital allocation, the correlation structure is key in the classical portfolio optimization problem, as shown in the seminal work of Markowitz (1952).

Generally, the quality of the estimated matrices increases with the length of the time series, i.e., the amount of data used. For small datasets the matrices have a large variance and may even be singular or indefinite. In financial context, however, using long time series results in biased estimates of the correlation structure, since the dependence of asset returns is not constant in time (see, e.g., King and Wadhwani (1990) for an early review).

The problem is that standard estimators equally weight all parts of the dataset. By consequence, out-of-date and improper information highly affect the estimates. This paper tackles this problem by introducing a new weighted estimator of the correlation or covariance matrix. This estimator makes use of enough data to adequately limit its variance but - in order to minimize its bias - focuses only on parts of the data where the market is in similar market conditions, i.e., it exhibits the same correlation structure.

To reduce the effects of time changing structures, common approaches in the literature choose time intervals where the structures are approximately constant. Examples of such approaches are exponentially weighted estimators like the RiskMetrics estimators (see, e.g., Longerstaey and Spencer (1996)) or the estimators discussed in Lee and Stevenson (2003). Since these estimators only use a small part of the data, they show a large variance. Moreover, whenever the number of effectively used observations is not large compared to the dimensions of the time series, estimated correlation and covariance matrices may be regarded as completely random. Laloux et al. (1999) showed in an empirical example that in such cases of the spectrum of estimated correlation matrices equal the spectrum of random matrices and only their largest eigenvalues may be estimated adequately.

Solutions to this problem involve reducing the dimensionality of the problems by imposing some structure on the correlations, e.g., by using factor models or shrinkage estimators as in Ledoit and Wolf (2004) or by noise reduction techniques, e.g., Random Matrix Filtering (see Plerou et al. (2002)) or Power Mapping (Schäfer et al. (2009)). Other approaches reduce the dimensionality by using conditional models of the correlation matrices going back to the work of Bollerslev (1986). A short overview of these practices may be found in Andersen et al. (2007).

With the availability of intraday high frequency financial data, it was expected that finer sampled data would effectively enlarge the datasets and improve estimates of parameters. However, when return data is observed on shorter time intervals, it is contaminated by market microstructure effects. These effects influence estimators and induce bias and noise (see, e.g., for a recent discussion Bandi et al. (2008)). Possible reasons include asynchrony and decimalization effects (see, e.g., Münnix et al. (2010a, b)).

Since the amount of data for the estimation may only be increased by either considering a longer time period or by sampling on higher frequencies, the mentioned properties of financial time series limit the amount of usable data. Longer time intervals bias the estimators due to the time changing nature of the matrices. Higher frequencies intensify the effects of the market microstructure on the estimators.

In this paper, we circumvent these limits. We propose to enlarge the amount of usable data by adaptively including different parts of the time series with similar correlation structures into the estimator. We therefore introduce a similarity measure which measures the degree of similarity between days of the time series based on probe correlation estimations. We demonstrate the application of the measure on assessing similarities on stock returns from the S&P 500 index. The measure reliably detects regime changes in the data as well as the special market situation during the financial crisis in .

The similarity measure enables us to construct a weighting scheme for correlation or covariance estimators that attaches high weights on similar parts of the data and suppresses distortions. In a simulation study, we demonstrate that these similarity weighted estimators show smaller bias and variance than unweighted or exponentially weighted estimators. The results hold for constant as well as for dynamic correlation structures in the data. In a real data application we apply our estimator to covariance estimation in the context of mean-variance portfolio optimization. We use time-series of stocks from the S&P 500 index and randomly choose stocks to build up portfolios. We show that optimal portfolios which are based on the similarity weighted covariance estimator outperform alternative approaches with respect to realized volatility and realized return.

The paper is organized as follows. Section II introduces the measure of similarity. In section III, a similarity based weighting scheme for estimators of correlation or covariance is constructed. Section IV contains a simulation study analyzing variance and bias of the resulting estimators. In section V we empirically apply the estimators in the context of mean-variance portfolio optimization. Section VI concludes.

## Ii Measuring Market Similarity

We measure the degree of similarity in the market’s correlation structure by the norm of the difference of the correlation matrices and of the times and i.e.,

(1) |

where represents the induced matrix -norm of the real valued matrix , which is the square root of largest eigenvalue of the matrix .

The correlation matrices and are estimated on a backward-looking rolling window of length The window length will be indicated by a superscript, i.e., If outliers are present in the data, the estimates are based on Spearman’s rank correlation instead of Pearson’s product moment correlation as this estimator is more robust to non-normal distributions. Since the estimates should be unbiased for time varying correlations, the use of small window lengths is recommended. As discussed in Laloux et al. (1999), this results in noisy estimates of the matrices and only the largest eigenvalues of the matrices are adequately estimated. However, the similarity measure (1) is based on the -norm and thus depends only on this largest eigenvalue, which can be estimated even for small values of

Figure 1 illustrates the evolution of the similarity measure for the example of the assets, that were continuously in the S&P 500 index between Aug and Jan . The similarity measure is evaluated for every day between Aug and Jan and depicted as a matrix. The axes represent time, therefore the evolution of the market related to a specific point in time is given by the upright (or vertical) intersection through this point. Darker regions on this intersection are less similar and brighter regions more similar to the situation at the specific point in time. In this illustration, the the financial crisis causes a shaded area from Oct 2008 to Mar 2009. The correlation structure in this period is completely different from any period before. After this period we find the market stabilizing: The correlation structure becomes similar to previous market states again. Beside the financial crisis, we can find regions for any point in which the correlation structure was similar and regions where it was different.

Furthermore, we are able to identify a regime switch in the correlation structure at the end for Feb , indicated by a shift from light to dark shared areas. This transition is reflected in a raised average correlation level which affects the measure of similarity. Figure 2 shows the average correlation of the assets over time. Between Feb 2007 and Apr 2007 the overall level of correlation increases, indicating the new correlation regime. The sharp transition on Feb 2007 was induced by large overall price drop of the stocks in the S&P 500. This originated in drastic events on the chinese stock market^{1}^{1}1See, e.g., Cover Story of Bloomberg Businessweek, Mar 12 2007: What The Market Is Telling Us..

## Iii Similarity Weighted Estimators

The similarity measure may serve as a weighting scheme for estimators of correlation or covariance matrices. With respect to the reference point the scheme inscribes high weights to periods where the market behaved in a similar manner. On the other hand, the periods in which the market behaved very differently are suppressed. Therefore, consider the adapted similarity measure

(2) |

where is the total number of considered time steps, i.e., the length of the time series. The factor refers to the number of assets to include. It is easily checked that represents the theoretical maximum possible value of , i.e., the highest possible dissimilarity.

We note that the probe matrices in equation (1) are estimated with window length Therefore, within the timespan they share identical values with the probe matrix at is then dominated by the amount of identical values and not by the estimated similarity. Therefore, the similarity measure is not reliable within this region and is set to the maximum value of the other timespans, resulting in a corrected measure

(3) |

A normalized weighting scheme for the estimation of the correlation or covariance matrix or at time is then

(4) |

resulting in the weighted estimators

(5) |

The superscript again denotes the respective window length of the estimators. For large and time series with dynamic correlation structure, the weighting scheme should be restricted to the largest values of This leads to a complete suppression of dissimilar parts of the data. Let denote the -th largest value of The restricted scheme is then given by

(6) |

with

The unbiasedness of the estimators (5) in time series, where the underlying correlation matrix is constant, is easily checked. However, due to fluctuations of the weights their variances are expected to be slightly larger than for a constant non-adaptive weighting scheme These effects are explored in the simulation study in the next section.

## Iv Simulation Study

The study presented here aims at the validation of the estimators introduced in the last section. We estimate correlation and compare it to standard estimators with respect to the bias and variance. The study consists of scenarios of normally distributed daily returns of assets. The scenarios are constructed similarly to the testing environments in Pafka and Kondor (2004).

The first scenario is equicorrelation with equicorrelation parameter This means that all pairwise correlations of the correlation matrix of the asset returns are equal to for

In the second and third scenarios, the market consists of two equicorrelated branches, the first 8 assets with equicorrelation parameter and the second 8 assets with . Assets of two different branches are equicorrelated with equicorrelation parameter The equicorrelation parameters of the branches change over time, i.e., and

In the second scenario, the market switches deterministically in turn between three different regimes. Each regime lasts trading days. In regime , the branches are equicorrelated with parameters and In the second regime, these parameters are both equal to in the third regime, they are and respectively.

In the third scenario, the parameters and change sinusoidally with the trading days according to:

Figure 3 depicts the theoretical similarity matrices of the second and third scenario for the first trading days. The discrete regimes of the second scenario are clearly visible while the similarity matrix of the third scenario shows no sudden changes.

The similarity weighted estimator is compared to benchmark estimators. The first benchmark is the standard Pearson correlation estimator based on the last returns. As the second benchmark, we use the RiskMetrics exponentially weighted correlation estimator. The estimator weights the -th recent return with weight The weights are chosen according to

as suggested by Longerstaey and Spencer (1996).

We estimate the correlation matrix in all three scenarios for the days , and To estimate mean and variance of the estimators, each simulation is independently repeated times. The results are presented in tables 1 to 3 which show the means and sample standard deviations of the parameters of interest over the repetitions for the 3 estimators.

Table 1 shows the results of scenario . The parameter is estimated adequately in all cases, which confirms that all estimators are unbiased in this setup. As to be expected, the standard estimator has the lowest variance. It uses a constant weighting scheme. This is known to be optimal, when the underlying correlation is constant. In this setup, the adaptive weighting scheme of the similarity weighted estimator should also equally weight all observations. However, due to stochastic fluctuations the weights vary. Therefore, the variance of the estimator is slightly larger than the variance of the standard estimator. The exponential weighted scheme suffers the highest variance as it heavily weights the most recent observations. This results in an unbalanced weighting scheme which is not optimal in this scenario.

The results of scenario are shown in table 2. The standard estimator is highly biased since its weighting scheme weights data from all regimes equally. Unlike the standard estimator, the exponential estimator weights the most recent observations most and therefore seems unbiased. Again, its variance is the largest among the three considered estimators. The similarity weighted estimator shows variances comparable to the variance of the unweighted estimator but is nearly unbiased. Table 3 shows the results of scenario Since in this scenario the true parameters change continuously in time, the scenario tests if the adaptive scheme given by the similarity measure separates the similar regions from the dissimilar ones in an adequate way. The results are analogue to the results of scenario but for the days and also the similarity weighted and exponentially weighted estimators deviate from the theoretical values. However, they both are much closer to the theoretical value than the unweighted estimator.

It is worthwhile to note that in all scenarios the bias of the similarity weighted estimator is similar to the bias of the exponentially weighted estimator. The standard deviation of the similarity weighted estimator, however, is only slightly larger than the standard deviation of the unweighted estimator and much smaller than the standard deviation of the exponentially weighted estimator.

similarity | unweighted | exponential | |||||
---|---|---|---|---|---|---|---|

day | |||||||

1000 | 0.7 | 0.6974 | 0.0364 | 0.6979 | 0.0296 | 0.6947 | 0.0736 |

2500 | 0.7 | 0.6991 | 0.0403 | 0.7002 | 0.0288 | 0.6977 | 0.0729 |

5000 | 0.7 | 0.6973 | 0.0429 | 0.7004 | 0.0296 | 0.7022 | 0.0718 |

similarity | unweighted | exponential | |||||
---|---|---|---|---|---|---|---|

day | |||||||

1000 | 0.7 | 0.6605 | 0.0339 | 0.4992 | 0.0448 | 0.6911 | 0.0759 |

0.2 | 0.2007 | 0.0528 | 0.1995 | 0.0552 | 0.1925 | 0.1350 | |

0.3 | 0.3368 | 0.0498 | 0.5000 | 0.0442 | 0.3002 | 0.1299 | |

2500 | 0.7 | 0.6792 | 0.0341 | 0.4985 | 0.0456 | 0.6883 | 0.0734 |

0.2 | 0.2026 | 0.0551 | 0.1996 | 0.0553 | 0.1975 | 0.1363 | |

0.3 | 0.3199 | 0.0464 | 0.4989 | 0.0443 | 0.3019 | 0.1288 | |

5000 | 0.5 | 0.4992 | 0.0492 | 0.4972 | 0.0448 | 0.5010 | 0.1072 |

0.2 | 0.2005 | 0.0623 | 0.1987 | 0.0558 | 0.1947 | 0.1384 | |

0.5 | 0.4994 | 0.0502 | 0.4995 | 0.0458 | 0.4946 | 0.1076 |

similarity | unweighted | exponential | |||||
---|---|---|---|---|---|---|---|

day | |||||||

1000 | 0.1402 | 0.2144 | 0.0548 | 0.4941 | 0.0457 | 0.1927 | 0.1391 |

0.2 | 0.1994 | 0.0524 | 0.1997 | 0.0561 | 0.1951 | 0.1374 | |

0.6598 | 0.5796 | 0.0429 | 0.3058 | 0.0532 | 0.5994 | 0.0869 | |

2500 | 0.6598 | 0.6012 | 0.0478 | 0.3062 | 0.0540 | 0.6029 | 0.0891 |

0.2 | 0.2007 | 0.0529 | 0.2007 | 0.0559 | 0.1992 | 0.1363 | |

0.1402 | 0.1994 | 0.0516 | 0.4935 | 0.0459 | 0.1905 | 0.1372 | |

5000 | 0.6598 | 0.6692 | 0.0361 | 0.4955 | 0.0457 | 0.6767 | 0.0804 |

0.2 | 0.1993 | 0.0553 | 0.1996 | 0.0552 | 0.1979 | 0.1360 | |

0.1402 | 0.1302 | 0.0469 | 0.3030 | 0.0539 | 0.1221 | 0.1397 |

## V Application to financial data

In this section, we apply our estimator to financial data in the context of mean-variance portfolio allocation. The application is motivated by Engle and Colacito (2006) who showed that the realized volatility of theoretically optimal portfolios is lowest if the covariance matrices for the optimization process are correctly specified. We therefore compare realized volatility and return of various portfolios drawn from the S&P 500. The study shows that portfolios based on the similarity weighted estimator as discussed in this paper outperform alternative portfolios. We conclude that these similarity weighted estimators perform very well in real data applications.

The value of a portfolio consisting of assets with prices and corresponding portfolio weights () is given by

(7) |

where refers to the vector of asset prices and contains the respective weights.

Consider an investment period from day to day Let and be covariance matrix and the expectation of the asset returns over the period. Then portfolio variance and expectation at time are given by

where is a vector of ones. Let denote the daily returns of the portfolio over the investment period. Then

is the realized volatility of the portfolio which is a measure of the portfolios’ risk over the investment period.

In mean-variance portfolio optimization as introduced by Markowitz (1952), optimal portfolio weights are derived by minimization problems of the form

(8) |

subject to certain constraints, e.g.,

(9) |

(budget restriction). The parameter is the investors’ risk tolerance parameter. A value denotes no risk tolerance. In this case, the investor’s only aim is to minimize the portfolio variance. Large values of denote risk neutrality, i.e., the investor maximizes the expected portfolio return only.

Since different investors have different risk tolerance levels, we focus on two special cases of the minimization problem. We consider the minimum-variance portfolio (MVP), i.e., the portfolio of minimal variance without further constraints, and the portfolio with minimal variance under the constraint of a fixed target portfolio return (TRP). The minimum-variance portfolio is the solution of equation (8) when is set to zero, i.e., the investor is not risk tolerant. To obtain portfolio can easily be expressed by the target return

(10) |

where and .

In a recent paper, Kritzman et al. (2010) argue that minimum-variance portfolios outperform various other strategies of portfolio optimization, even with respect to the their return.

By contrast, DeMiguel et al. (2009) raise the question whether portfolio optimization pays out at all. In their results, optimized portfolios do not significantly outperform naive diversified portfolios, i.e., portfolios where the same amount is invested in assets. We therefore include this naive portfolio in our study, even though the naive portfolio does not depend on estimators of correlation or covariance. The portfolio strategies MVP and TRP allow to rank the estimators of the covariance structure according to the portfolio performance, while the outcomes of the naive portfolio confirm the overall plausibility of the results.

The basic idea of the study is to calculate optimal portfolios for every day of our dataset and to evaluate them over some investment horizon with respect to risk (realized volatility) and return. We then compare the results of the different strategies and estimators.

Optimization type | |||
---|---|---|---|

Evaluation | unweighted | weighted | naive |

14 day | 0.00052 | 0.00047 | 0.00124 |

28 day | 0.00102 | 0.00090 | 0.00252 |

56 day | 0.00231 | 0.00211 | 0.00593 |

We use the same dataset as in section II, i.e., the assets of the S&P index that are included in the index from to the beginning of . From this dataset, we randomly choose 10 portfolio constellations of stocks each. For every trading day from Aug to Nov we compute portfolio weights for the constellations regarding to the strategies. The necessary covariance estimates rely on the similarity weighted estimator and alternatively on the unweighted estimator. For the first estimator, we need a similarity measure, which is determined as discussed in section II. The probe matrices to calculate the similarity measure rely on moving windows of trading days and are based on all assets of the dataset. Window lengths between to trading days lead to similar results. However, the results for window lengths around seem to be quite representative. The weighting scheme of the estimator includes the most similar past days. The unweighted estimator is based on a moving window of days. The weights of the target return portfolio rely on an additionally specified target return and on estimates of the vector of expected returns as well. The vector is estimated by the returns of the portfolio’s stocks for every trading day from a moving window of trading days.

The target return is then adaptively chosen to be percentage points above the average entree of

The evaluation results of realized volatility and returns are shown in Fig. 5, 4 and tables 4 and 5. The evaluation periods are , and trading days, respectively. The results shown are averages of the portfolio constellations. Visual inspection of the figures shows that the naive portfolio performs worst, especially during the financial crisis. In that time, the incorporation of the covariance structure into the portfolio weights pays out. Realized volatility of the optimized portfolios consistently lies below the realized volatility of the naive portfolios whereas the similarity weighted scheme obtains the best results. The results are robust for the considered investment horizons which is shown in the tables in more detail.

In both cases, in the minimum variance portfolio (MVP) as well as in the 5% above market drift portfolio (TRP), the similarity weighting significantly reduces the realized risk. Moreover, the TRP case reveals that the realized return could be improved compared to the unweighted optimization, although the naive portfolio features an even higher return.

Optimization type | ||||
---|---|---|---|---|

Evaluation | unweighted | weighted | naive | |

14 day | Risk | 0.00054 | 0.00048 | 0.00124 |

Return | -0.00391 | -0.00252 | -0.00103 | |

28 day | Risk | 0.00108 | 0.00095 | 0.00252 |

Return | -0.00918 | -0.00567 | -0.00202 | |

56 day | Risk | 0.00244 | 0.00224 | 0.00593 |

Return | -0.02138 | -0.01547 | -0.00362 |

## Vi Conclusion

We introduced a measure that quantifies the similarity of the correlation structure for two different times. This measure gives a clear indication for drastic changes in the market structure as past the beginning of the financial crisis 2008.

This measure was adapted to calculate weighted correlation and covariance matrices in which information that originated from a similar market state is weighted higher.

We analyzed the resulting similarity weighted estimators in a simulation study and applied it to a mean-variance portfolio optimization in a historical study. The results show that our method reduces the portfolio volatility as well as it enhances the realized return compared to the use of unweighted correlations. The application of similarity weighted estimators is especially advantageous in periods in which the market structure changes drastically.

## Acknowledgement

M.C.M. acknowledges financial support from Studienstiftung des deutschen Volkes.

## References

## References

- Andersen et al. (2007) Andersen, T.G., Bollerslev, T., Christoffersen, P. and Diebold, F.X., Practical Volatility and Correlation Modeling for Financial Market Risk Management. In The Risks of Financial Institutions, NBER Chapters, pp. 513–548, 2007, National Bureau of Economic Research, Inc.
- Bandi et al. (2008) Bandi, F., Russell, J. and Zhu, Y., Using High-Frequency Data in Dynamic Portfolio Choice. Econometric Reviews, 2008, 27, 163–198.
- Bollerslev (1986) Bollerslev, T., Generalized autoregressive conditional heteroskedasticity. Journal of Econometrics, 1986, 31, 307 – 327.
- DeMiguel et al. (2009) DeMiguel, V., Garlappi, L. and Uppal, R., Optimal Versus Naive Diversification: How Inefficient is the 1/N Portfolio Strategy?. The Review of Financial Studies, 2009, 22, 1915–1953.
- Engle and Colacito (2006) Engle, R. and Colacito, R., Testing and Valuing Dynamic Correlations for Asset Allocation. Journal of Business & Economic Statistics, 2006, 24, 238–253.
- King and Wadhwani (1990) King, M. and Wadhwani, S., Transmission of volatility between stock markets. The Review of Financial Studies, 1990, 3, 5–33.
- Kritzman et al. (2010) Kritzman, M., Page, S. and Turkington, D., In Defense of Optimization: The Fallacy of 1/N. Financial Analysts Journal, 2010, 66, 31–39.
- Laloux et al. (1999) Laloux, L., Cizeau, P., Bouchaud, J.P. and Potters, M., Noise Dressing of Financial Correlation Matrices. Physical Review Letters, 1999, 83, 1467–1470.
- Ledoit and Wolf (2004) Ledoit, O. and Wolf, M., Honey, I Shrunk the Sample Covariance Matrix. The Journal of Portfolio Management, 2004, 30, 110–119.
- Lee and Stevenson (2003) Lee, S. and Stevenson, S., Time weighted portfolio optimisation. Journal of Property Investment & Finance, 2003, 21, 233–249.
- Longerstaey and Spencer (1996) Longerstaey, J. and Spencer, M., RiskMetrics Technical Document. 1996, 4th edition, J.P.Morgan/Reuters, New York.
- Markowitz (1952) Markowitz, H.M., Portfolio Selection. The Journal of Finance, 1952, 7, 77–91.
- Münnix et al. (2010a) Münnix, M.C., Schäfer, R. and Guhr, T., Compensating asynchrony effects in the calculation of financial correlations. Physica A, 2010a, 389, 767–779.
- Münnix et al. (2010b) Münnix, M.C., Schäfer, R. and Guhr, T., Impact of the tick-size on financial returns and correlations. Physica A, 2010b, In Press, Accepted Manuscript Http://dx.doi.org/10.1016/j.physa.2010.06.037.
- Pafka and Kondor (2004) Pafka, S. and Kondor, I., Estimated correlation matrices and portfolio optimization. Physica A, 2004, 343, 623 – 634.
- Plerou et al. (2002) Plerou, V., Gopikrishnan, P., Rosenow, B., Amaral, L.A.N., Guhr, T. and Stanley, H.E., Random matrix approach to cross correlations in financial data. Physical Review E, 2002, 65, 066126.
- Schäfer et al. (2009) Schäfer, R., Nilsson, N. and Guhr, T., Power mapping with dynamical adjustment for improved portfolio optimization. Quantitative Finance, 2009.