Charta is on Google Play: practise on the go. Get the app
Charta

From sample data, calculate estimates of how two random variables covary and how they correlate.

FRM® Part I · Quantitative Analysis · Sample Moments · FRM1.QA.5.k

The idea

The sample covariance of paired data is the sum of cross-products of deviations, divided by n − 1. Covariance = Σ(x − x̄)(y − ȳ) ÷ (n − 1). It is positive when the variables tend to be above or below their means together, and its size depends on the units. The sample correlation divides the covariance by the product of the two sample standard deviations. Corr = covariance ÷ (sx × sy). It is unit-free and lies between −1 and 1. If you use the divisor n in the covariance, use it in the variances too. The divisor then cancels in the correlation. From sums, the centred cross-sum has a shortcut. Cross-sum = Σxy − (Σx × Σy) ÷ n. Correlation measures only linear dependence, so a correlation of zero does not mean the variables are independent.

Formulas

Sample covariance

sXY = Σ(xᵢ − x̄) × (yᵢ − ȳ) ÷ (n − 1)

xᵢ
each observation of X
yᵢ
the paired observation of Y
x̄
the sample mean of X
ȳ
the sample mean of Y
n
the number of pairs

Its size depends on the units. Dividing by the two sample standard deviations gives the correlation, in which the divisor cancels if used consistently.

A practice question

From the question bank, with the reason each wrong option is wrong.

Which expression is the sample covariance of paired observations (x_i, y_i), i = 1, ..., n, with the usual divisor?

  1. The sum of (x_i - x-bar)² (y_i - y-bar)², divided by n - 1.Why not: Squares the deviations, which gives a fourth-order cross moment instead of the covariance.
  2. The sum of x_i y_i, divided by n - 1.Why not: Omits the centring on the sample means.
  3. The sum of (x_i - x-bar)(y_i - y-bar), divided by n - 1. - correct
  4. The sum of (x_i - x-bar)(y_i - y-bar), divided by the product of the two sample standard deviations.Why not: This divides by the standard deviations, producing the correlation, not the covariance.

The sample covariance averages the product of deviations from the sample means. With the n - 1 divisor it is unbiased; dividing by the two standard deviations instead gives the sample correlation.

A harder one

Six paired observations of two risk factor moves are X = 2, 4, 5, 7, 9, 12 and Y = 1, 3, 6, 6, 10, 11. What is the sample covariance with the n - 1 divisor?

  1. 13.5 - correct
  2. 11.25Why not: Uses the divisor n instead of n - 1.
  3. 67.5Why not: Reports the sum of cross-products without dividing.
  4. 61.6Why not: Sums the raw products x_i y_i without subtracting the sample means.

x-bar = 6.5, y-bar = 6.167. Sum of cross-deviations = 67.5. Divide by n - 1 = 5: 13.5.

The hardest tier

From n = 10 paired observations a risk analyst records: sum of x = 20, sum of y = 30, sum of xy = 75, sum of x² = 60, sum of y² = 110. What is the sample correlation?

  1. 0.92Why not: Uses the raw sums without centring on the sample means, which overstates the correlation.
  2. 0.83Why not: Mixes divisors: the covariance uses n - 1 but the variances in the denominator use n.
  3. 0.75 - correct
  4. 0.67Why not: Mixes divisors the other way: the covariance uses n while the variances use n - 1.

Centred cross-sum = 75 - 20 x 30/10 = 15; centred sums of squares are 20 and 20. Correlation = 15/sqrt(20 x 20) = 0.75. The divisor cancels if used consistently.

In the app: 6 practice questions on this outcome, spaced review that brings it back before you forget it.

Start free →

More in Sample Moments