Skip to content

Actuarial Statistics · Jointly distributed random variables

Covariance and Correlation for IAI Actuarial Statistics

Updated 11 October 2026 · Fact-checked

Covariance measures how two random variables move together: Cov(X,Y) = E[XY] − E[X]E[Y]. Correlation rescales it to lie between −1 and 1: ρ = Cov(X,Y) ÷ (σX σY). To solve a question, find the means, E[XY] and the variances, then substitute. Independence gives zero covariance, but not the reverse.

Understand Covariance and Correlation

When two random variables are defined on the same outcome, you often want to know whether they move together. If X is the claim count and Y is the average claim size, a high X may tend to come with a high Y. Covariance puts a number on this tendency.

Start with expectation of a function of two variables. For a joint pdf f(x,y), E[g(X,Y)] = ∫∫ g(x,y) f(x,y) dy dx. For a joint pmf, you replace the integrals with sums. You do not need the marginal distributions for this, only the joint one.

Covariance is the expected product of the deviations from the means: Cov(X,Y) = E[(X − μX)(Y − μY)]. It is positive when X and Y tend to be above or below their means together. It is negative when one tends to be high while the other is low. It is zero when there is no linear tendency. Its size depends on the units, so it is hard to interpret by itself.

Correlation fixes this by dividing by both standard deviations. The result ρ is unit-free and always lies between −1 and 1. A value of 1 or −1 means Y is an exact linear function of X. Values near 0 mean a weak linear relationship. Correlation measures only linear dependence.

Covariance also drives the variance of a sum. Var(X + Y) = Var(X) + Var(Y) + 2Cov(X,Y). If the variables are independent, the covariance term is zero. If they are positively correlated, the variance of the sum is larger than the sum of the variances. This is the core idea behind pooling risks and aggregate claims.

Key rules to remember

Expectation of a function
E[g(X,Y)] = ∫∫ g(x,y) f(x,y) dy dx (continuous); Σ Σ g(x,y) P(X=x, Y=y) (discrete)
Integrate over the full support of the joint pdf. Watch for limits that depend on the other variable.
Covariance definition
Cov(X,Y) = E[(X − μX)(Y − μY)]
Use this to understand the idea. It is rarely the fastest way to calculate.
Covariance computing formula
Cov(X,Y) = E[XY] − E[X]E[Y]
Use this in most calculations.
Correlation coefficient
ρ = Corr(X,Y) = Cov(X,Y) ÷ √(Var(X) Var(Y))
Defined only when both variances are positive and finite. −1 ≤ ρ ≤ 1.
Variance of a sum
Var(X + Y) = Var(X) + Var(Y) + 2Cov(X,Y)
Holds for any X and Y with finite variances, dependent or not.
Variance of a linear combination
Var(aX + bY) = a²Var(X) + b²Var(Y) + 2ab Cov(X,Y)
For a difference, b is negative, so the covariance term changes sign.
Covariance with constants
Cov(aX + b, cY + d) = ac Cov(X,Y)
Adding a constant does not change covariance. Correlation changes sign only if ac is negative.
Independence
If X and Y are independent, Cov(X,Y) = 0 and E[XY] = E[X]E[Y]
The reverse is not true. Zero covariance does not imply independence.
Covariance of sums
Cov(X + Y, Z) = Cov(X,Z) + Cov(Y,Z); Cov(X,X) = Var(X)
Covariance is bilinear and symmetric.

How to solve Covariance and Correlation questions

Use this method for any question that asks for covariance, correlation or the variance of a sum from a joint distribution.

  1. 1Write down the joint pmf or pdf and its support. Check that it sums or integrates to 1 if you are unsure.
  2. 2Find E[X] and E[Y]. Use the marginal distributions, or integrate x f(x,y) over both variables directly.
  3. 3Find E[XY] by summing or integrating xy f(x,y) over the full support.
  4. 4Calculate Cov(X,Y) = E[XY] − E[X]E[Y].
  5. 5Find E[X²] and E[Y²], then Var(X) = E[X²] − (E[X])² and Var(Y) likewise.
  6. 6Find ρ = Cov(X,Y) ÷ √(Var(X) Var(Y)) if correlation is asked.
  7. 7For a linear combination, substitute into Var(aX + bY) = a²Var(X) + b²Var(Y) + 2ab Cov(X,Y), keeping the signs of a and b.
  8. 8Check the result: ρ must lie between −1 and 1, and any variance must be positive.

Quickest way: Shortcut using independence, symmetry and standard results

When to use it: Use it under time pressure, especially in multiple-choice questions, before you start any double integral.

  1. Check whether the support is a rectangle and f(x,y) factorises as g(x)h(y). If so, X and Y are independent and Cov = 0.
  2. If the support is not a rectangle (for example 0 < y < x), the variables are dependent. Do not assume zero covariance.
  3. Use the sign to eliminate options. If larger x forces larger y, covariance is positive.
  4. If the question gives Var, Var and ρ, get Cov = ρ σX σY directly and go straight to the variance formula.
  5. For symmetric joint pdfs such as x + y on the unit square, E[X] = E[Y] and Var(X) = Var(Y), so you only need to compute one of each.
  6. Compute E[XY] first, since it is the only quantity that needs the joint distribution.

Common mistakes in Covariance and Correlation

  • Writing E[XY] = E[X]E[Y] without checking independence

    The product rule is true so often in simple examples that it feels automatic.

    Fix: Use it only when you can show independence. Otherwise compute E[XY] from the joint distribution.

  • Concluding that zero covariance means independence

    Students remember that independence implies zero covariance and reverse the statement.

    Fix: Covariance measures only linear association. Independence needs the joint distribution to factorise.

  • Dropping the covariance term in Var(X + Y)

    The independent case is practised most, so the shortcut Var(X) + Var(Y) gets used everywhere.

    Fix: Always write the full formula first, then set Cov to zero only if you can justify it.

  • Getting the sign wrong for Var(X − Y)

    Students subtract the variances, or forget that the cross term has coefficient −2.

    Fix: Var(X − Y) = Var(X) + Var(Y) − 2Cov(X,Y). Variances always add.

  • Using the wrong limits when the support is triangular

    The inner limit depends on the outer variable, and students treat the region as a rectangle.

    Fix: Sketch the region. Put variable limits on the inner integral and constants on the outer one.

  • Reporting a correlation outside −1 to 1, or forgetting to take the square root

    Students divide by Var(X)Var(Y) instead of √(Var(X)Var(Y)), or make an arithmetic slip.

    Fix: Divide by the product of standard deviations. If |ρ| > 1, recheck your working.

Worked examples

Example 1

X and Y have joint pdf f(x,y) = x + y for 0 < x < 1 and 0 < y < 1, and 0 otherwise. Find Cov(X,Y) and Corr(X,Y).

Show the solution
  1. Marginal of X: f_X(x) = ∫₀¹ (x + y) dy = x + 1/2. By symmetry f_Y(y) = y + 1/2.
  2. E[X] = ∫₀¹ x(x + 1/2) dx = 1/3 + 1/4 = 7/12. By symmetry E[Y] = 7/12.
  3. E[XY] = ∫₀¹∫₀¹ xy(x + y) dy dx = ∫∫ (x²y + xy²) dy dx. The first part is (1/3)(1/2) = 1/6 and the second part is (1/2)(1/3) = 1/6. So E[XY] = 1/3.
  4. Cov(X,Y) = 1/3 − (7/12)² = 48/144 − 49/144 = −1/144.
  5. E[X²] = ∫₀¹ x²(x + 1/2) dx = 1/4 + 1/6 = 5/12.
  6. Var(X) = 5/12 − 49/144 = 60/144 − 49/144 = 11/144. By symmetry Var(Y) = 11/144.
  7. Corr = (−1/144) ÷ (11/144) = −1/11.

Answer: Cov(X,Y) = −1/144 and Corr(X,Y) = −1/11 ≈ −0.091, a weak negative linear relationship.

Example 2

Random variables X and Y have Var(X) = 4, Var(Y) = 9 and correlation coefficient −0.5. Find Var(X + Y) and Var(2X − Y).

Show the solution
  1. Standard deviations: σX = 2 and σY = 3.
  2. Cov(X,Y) = ρ σX σY = (−0.5)(2)(3) = −3.
  3. Var(X + Y) = 4 + 9 + 2(−3) = 7.
  4. Var(2X − Y) = 2²(4) + (−1)²(9) + 2(2)(−1)(−3) = 16 + 9 + 12 = 37.

Answer: Var(X + Y) = 7 and Var(2X − Y) = 37.

Exam tips

  • In written answers, state the formula in standard notation before substituting. Method marks are usually awarded for it.
  • In multiple-choice questions, check the sign of the covariance first. It often removes two options quickly.
  • If the support is not a rectangle, say so and state the limits clearly. Wrong limits are a common way to lose marks.
  • Check that |ρ| ≤ 1 and that variances are positive before you finish.
  • For computer-based questions, state the assumption (sample or population covariance) and say which function or formula you used. In R, cov() and cor() use the sample versions by default.

Practice questions from Jointly distributed random variables

Covariance and Correlation in other exams

The same ground in other exams, if you are preparing for more than one or want another angle on it.

Covariance and Correlation: frequently asked questions

What is the difference between covariance and correlation?

Covariance shows the direction of a linear relationship, but its size depends on the units of X and Y. Correlation divides covariance by the two standard deviations, so it is unit-free and lies between −1 and 1. Use correlation to compare the strength of relationships.

How do I calculate covariance from a joint pdf?

Find E[X], E[Y] and E[XY] by integrating over the support of the joint pdf. Then use Cov(X,Y) = E[XY] − E[X]E[Y]. Take care with the integration limits if the support is not a rectangle.

Does zero correlation mean the variables are independent?

No. Zero correlation means there is no linear relationship. Y could still depend on X in a non-linear way, for example Y = X² when X is symmetric about zero. Independence is a stronger condition.

What is the variance of the sum of dependent random variables?

Var(X + Y) = Var(X) + Var(Y) + 2Cov(X,Y). For several variables, add every variance plus twice the covariance of every pair. If the variables are independent, all covariance terms are zero.

What are the properties of the correlation coefficient?

It lies between −1 and 1, is symmetric in X and Y, and is unchanged by positive linear changes of scale or origin. It equals 1 or −1 only when Y is an exact linear function of X.