Finance Formulas

Quantitative Methods

core

Covariance and Correlation from a Joint Probability Table

Builds onExpected Value · Correlation from Covariance — if this page feels steep, start there.

Cov(RA,RB)=∑i=1npi (RA,i−E[RA])(RB,i−E[RB]),ρAB=Cov(RA,RB)σA σBCov(R_A,R_B) = \sum_{i=1}^{n} p_i\,\bigl(R_{A,i} - E[R_A]\bigr)\bigl(R_{B,i} - E[R_B]\bigr), \qquad \rho_{AB} = \frac{Cov(R_A,R_B)}{\sigma_A\,\sigma_B}

Reading the notation

pip_i
the probability of scenario i (boom, recession, ...). The probabilities across all scenarios add to 1
RA,iR_{A,i}
the return of asset A if scenario i happens; likewise R_{B,i} for asset B
E[RA]E[R_A]
the expected return of asset A: its probability-weighted average return, the sum of p_i R_{A,i}
RA,i−E[RA]R_{A,i} - E[R_A]
the surprise: how far asset A's return in this scenario is from its own expected return
(RA,i−E[RA])(RB,i−E[RB])(R_{A,i}-E[R_A])(R_{B,i}-E[R_B])
the product of the two surprises: positive when both assets beat (or both miss) expectations together, negative when one beats while the other misses
Cov(RA,RB)Cov(R_A,R_B)
covariance: the probability-weighted average of those products — the direction and strength of co-movement, in units of percent squared
ρAB\rho_{AB}
the correlation: covariance rescaled by both standard deviations so it always lies between −1 and +1

Why it must be true

Expected value tells you where each asset is centred; covariance tells you whether the two move together. In every scenario, ask: did asset A beat its expectation, and did asset B? If they tend to surprise in the same direction, the products of the surprises are mostly positive and covariance is positive; if one tends to zig when the other zags, covariance is negative.

Because each scenario has its own probability, the average of the products must be probability-weighted, exactly like an expected value. Covariance has awkward units (percent squared), so dividing by both standard deviations gives the correlation, a pure number between −1 and +1 that says how tightly the two are linked. It is the key input for diversification: the lower the correlation, the more portfolio variance falls.

The derivation

Covariance is the expected product of the two deviations from the means:

Cov(RA,RB)=E[(RA−E[RA])(RB−E[RB])]Cov(R_A,R_B) = E\bigl[(R_A - E[R_A])(R_B - E[R_B])\bigr]

For discrete scenarios with probabilities pip_i, an expectation is a probability-weighted sum:

Cov(RA,RB)=∑ipi (RA,i−E[RA])(RB,i−E[RB])Cov(R_A,R_B) = \sum_i p_i\,(R_{A,i}-E[R_A])(R_{B,i}-E[R_B])

Expanding the product gives the equivalent computing form Cov=E[RARB]−E[RA]E[RB]Cov = E[R_AR_B] - E[R_A]E[R_B], which is why using E[RARB]E[R_AR_B] alone (without subtracting the product of the means) overstates the covariance whenever the means are nonzero.

Dividing by the standard deviations — each computed from the same table as σ=∑pi(Ri−E[R])2\sigma = \sqrt{\sum p_i (R_i - E[R])^2} — scales the result:

ρAB=Cov(RA,RB)σAσB\rho_{AB} = \frac{Cov(R_A,R_B)}{\sigma_A\sigma_B}

When to reach for it

Two assets' returns are given under the same set of probability-weighted scenarios and you need their covariance or correlation (or one asset's expected return) from that table.

Listen for

“joint probability function / scenario table for returns”“covariance between the returns of asset A and asset B”“probability-weighted … boom / base case / recession”“correlation of returns computed from scenario probabilities”

Back-of-the-envelope

Estimate it in your head first — then the calculator only confirms.

  • ≈

    Expected returns first: compute E[RA]E[R_A] and E[RB]E[R_B], then the surprises in each scenario. A scenario where both surprises have the same sign contributes a positive product.

  • ≈

    Sign check from the table: if the better scenario for A is also the better one for B (both do well in the boom and badly in the recession), covariance must be positive; a hedge pattern gives a negative covariance.

  • ≈

    Correlation must lie in [−1,1][-1, 1]. A computed value outside that range means an error in the standard deviations or in the weights (probabilities not applied).

Traps in applying it

  • ✗Averaging the products without weighting by the scenario probabilities (or dividing by the number of scenarios).
  • ✗Using $E[R_AR_B]$ and forgetting to subtract $E[R_A]E[R_B]$.
  • ✗Dividing the covariance by the variances (or by one standard deviation) instead of the product of both standard deviations.
  • ✗Mixing units: covariance of percent returns is in percent SQUARED; entering returns as decimals (0.12) gives a number 10,000 times smaller than entering whole percents (12).

Limits & criticisms

A covariance estimated from a small scenario table is only as good as the subjective scenario probabilities and payoffs behind it, and three or four scenarios can badly understate the true tail co-movement. Covariance and correlation capture only linear association and are not stable through time — correlations typically jump toward 1 in crises, exactly when diversification is needed most. Finally, a zero covariance does not imply independence.

Where it came from

Francis Galton and Karl Pearson developed correlation in the 1880s–1890s while studying inheritance of traits; Pearson's product-moment coefficient (1896) is the one we use today. Its central role in finance comes from Harry Markowitz's 1952 portfolio theory: the risk of a portfolio depends not only on each asset's volatility but on every pairwise covariance.

Today scenario tables with joint probabilities are the standard way to build covariance inputs for a portfolio when there is no long history — stress tests, macro-scenario analyses and the covariance matrices behind optimizers are all built this way.

One identity, 3 questions

The exam can hide any variable. Each face below is the same equation solved for a different unknown — drill them separately.

Expected return of asset A

E[RA]=∑piRA,iE[R_A] = \sum p_i R_{A,i}

The probability-weighted average return: the first step before any surprise or covariance can be measured.

Drill this face →

Covariance from the joint table

Cov(RA,RB)=∑pi(RA,i−E[RA])(RB,i−E[RB])Cov(R_A,R_B) = \sum p_i (R_{A,i}-E[R_A])(R_{B,i}-E[R_B])

The probability-weighted product of surprises. Positive means the assets tend to beat or miss their expectations together.

Drill this face →

Correlation from the joint table

ρAB=Cov(RA,RB)σAσB\rho_{AB} = \frac{Cov(R_A,R_B)}{\sigma_A\sigma_B}

Covariance rescaled to a pure number between −1 and +1, ready to drop into the two-asset portfolio variance formula.

Drill this face →

On the BA II Plus

Worked example: An analyst models two assets under the economic scenarios in the exhibit, which gives each scenario's probability and each asset's return. The covariance of the returns of Asset A and Asset B, with returns measured in percent (so the answer is in percent squared), is closest to:

  1. 1.0.35 [×] 19 [+] 0.4 [×] 4 [+] 0.25 [×] 14 [+/−] [=] [STO] 1E[R_A] — store it
  2. 2.0.35 [×] 1 [+] 0.4 [×] 2 [+] 0.25 [×] 13 [=] [STO] 2E[R_B] — store it
  3. 3.0.35 [×] ( 19 [−] [RCL] 1 ) [×] ( 1 [−] [RCL] 2 ) [+] 0.4 [×] ( 4 [−] [RCL] 1 ) [×] ( 2 [−] [RCL] 2 ) [+] 0.25 [×] ( 14 [+/−] [−] [RCL] 1 ) [×] ( 13 [−] [RCL] 2 ) [=]probability × (A surprise) × (B surprise) for each scenario, added: the covariance

→ -56.55