CF LAB

Asset covariance

2-ASSET

For learning purposes only. Do not use this calculator or its data to make investment decisions. Results are simplified teaching examples, and company figures may be incomplete or out of date.

What is this?

Covariance measures whether two investments tend to move together. If one usually rises when the other rises, covariance is positive; if one tends to rise when the other falls, it is negative. Mixing assets that do not move perfectly together cancels out some of their ups and downs. That is diversification: less risk without giving up return.

Start with the made-up example, or pick two real companies listed on the Pakistan Stock Exchange to use their actual past share prices.

How to read the chart

  • The blue curve shows every possible mix of A and B.
  • The further the curve bends left, the more risk mixing removes.
  • The green band is the risk you remove compared with simply averaging A and B.
  • Grey lines show the two extremes: moving perfectly together (+1) or perfectly opposite (−1).
Covariance Cov(A,B)
0.0180= 180 %²
Positive: A and B tend to move together. Negative: they tend to move in opposite directions. Zero: no link.
Portfolio risk σp
19.35%
Expected return
14.40%
Risk removed by mixing
4.65 pts
Diversifying
What this means

Try this
How it’s calculated
About the data: sources and method

  • Prices: daily closing prices from the Pakistan Stock Exchange data portal, downloaded automatically every Saturday.
  • Returns: each weekly or monthly return uses the last closing price in that week or month: price ÷ previous price − 1. The current, unfinished week or month is not used.
  • No price adjustments: prices are as PSX reports them, so bonus shares, splits and dividends make a share price drop. A day when a share fell more than 11% while the market moved less than 5% is treated as one of these events, and the week or month containing it is left out (listed above for each company).
  • Yearly figures: average return × 52 (weekly) or × 12 (monthly); volatility × √52 or × √12. These are simple averages, not compound growth. Variances and covariances divide by n − 1.
  • Pairs: only weeks (or months) with a price for both shares are used, and a period with an unusual drop in either share is left out for both, so both shares are measured over exactly the same periods.
  • Rounding: figures loaded into the boxes are rounded to the decimals shown, and every calculation uses exactly those numbers.

Covariance matrix

Where your portfolio’s risk comes from