Faster Learning Tutorials

Covariance matrix definition and tutorial

Learning statistics and investments at the same time can be confusing. Case in point, did you know a covariance matrix is the same as a variance-covariance matrix?
  1. Define - Define a covariance matrix for investments.
  2. Context - Use it in a sentence.
  3. Video - See the video.
  4. Script - Read the transcript.
  5. Quiz - Test your knowledge.
by Paul Alan Davis, CFA, July 4, 2016
Updated: December 21, 2018
The covariance matrix can easily be transformed into the more interpretable correlation matrix.

Outline Back Next

~/ home  / finance  / glossary  / covariance matrix

Covariance Matrix


Covariance matrix is a convenient structure for storing variance and covariance figures for securities and factors. Covariance represents the co-movements between securities and can be generated using a single-variable linear regression. Alternatively, in a multi-variable regression it is common to use factors to measure co-movements. The matrix is used for the evaluation and analysis of risk and for portfolio construction.

Synonym: variance-covariance matrix

In a Sentence

Doc:  Because variance-covariance is redundant let's use covariance matrix here.
Tom:  So it's like calling it tuna instead of ahi tuna?


This video can be accessed in a new window or App , at the YouTube Channel or from below.

Covariance matrix definition for investment modeling (4:29)

Video Script

The script includes two sections where we visualize and demonstrate the calculation of the covariance matrix.


We're sitting here in Excel, and this is a snippet from our boot camp course.

This is one depiction of the covariance matrix, generated using the monthly returns for four stocks located on the Returns tab.

In this state, the covariance matrix isn't very interpretable to the naked eye, and useful for analysis, but that's not what it is for. It sits behind software for portfolio analysis and optimization.

If you'd like to brush up on the calculation of covariance, there will be a link to the video at the end.

A correlation matrix, like this, is interpretable because the scale of correlation ranges from -1 to +1. It is created from the covariance matrix. The creation of the covariance matrix helps, so let's head there now.


We will create a covariance matrix for four stocks.

So third-party risk model providers use linear algebra in statistical programming languages to generate the covariance matrix at scale for thousands of securities, but here we'll calculate one manually in Excel.

There are three types of covariance matrices: historical, single-index and multi-factor. We are using the easiest one here called historical.

The matrix structure is actually borrowed form linear algebra and is used for matrix multiplication, which we cover in the boot camp.

Set up a table like this with matching rows and column labels for holding the co-movements between each stock. And if you notice, down the diagonal in blue, is the calculation for covariance of a stock versus itself, which mathematically is variance, and that's where the name name variance-covariance matrix comes from, but it is more clear to call it a covariance matrix.

In the first cell, use the sample covariance using the =COVARIANCE.S function, then open parenthesis, select the first array, comma, second array, closed parenthesis and Enter. That's the variance of Microsoft.

Next, in the next row, we do the same thing but use the returns on Microsoft, then eBay and come up with a covariance of 0.0016 for the pair of stocks. See how it matches with this cell, logically.


Click box for answer.

A stock-by-stock covariance matrix for 3 stocks has 9 unique cells. | True or False?

False, 6 unique cells total, 3 variances and 3 covariance pairs

Questions or Comments?

Still unclear on the covariance matrix? Leave a question in the comments section on YouTube or check out the Quant 101 series, specifically the tutorial Create a Covariance Matrix.

Related Terms

Our trained humans found other terms in the category risk forecasting you may find helpful.

What's Next?

Click Subscribe if you'd like to learn more.

  • To see all terms in the Glossary, click Outline.
  • For a more granular look at Covariance, click Back.
  • To review what a Debt Security security is, click Next.

Outline Back Next

~/ home  / finance  / glossary  / covariance matrix

covariance matrix
variance covariance matrix
stock risk
covariance of stocks
investment co-movement
demeaned returns
forecast portfolio risk
portfolio optimization
risk model
investment risk
risk analysis
variance covariance matrix excel
portfolio covariance
portfolio risk analysis
stock risk measures