UNIHIVE

Study Hub UNIPORT MTH 260

MTH 260 · Probability and Statistics

Joint distributions, covariance and correlation

Two random variables together: joint and marginal distributions, independence, covariance and the correlation coefficient.

Our notes

1 min read

Joint distribution

For two discrete variables, p(x, y) = P(X = x and Y = y). Each row and column total gives a marginal distribution.

Example

X = number of tutorials attended (0 or 1), Y = grade points (2, 4):

Y = 2Y = 4p_X(x)
X = 00.30.10.4
X = 10.20.40.6
p_Y(y)0.50.51

Independent? p(0, 2) = 0.3 but p_X(0) p_Y(2) = 0.4 × 0.5 = 0.2. Not equal, so dependent.

For continuous variables, a joint pdf f(x, y) gives probabilities as volumes; marginals come from integrating out the other variable.

Covariance

Cov(X, Y) = E[(X − μ_X)(Y − μ_Y)] = E(XY) − E(X)E(Y).
In the table: E(X) = 0.6, E(Y) = 3, E(XY) = (1)(2)(0.2) + (1)(4)(0.4) = 2.0. Cov = 2.0 − 1.8 = 0.2 (positive: attending goes with higher grades).

Correlation coefficient

ρ = Cov(X, Y) / (σ_X σ_Y), always between −1 and 1.

  • ρ = ±1: an exact straight-line relation.
  • ρ = 0: no linear relation (there may still be a curved one).
  • Independent ⇒ ρ = 0, but ρ = 0 does not prove independence.

Sample correlation

From data: r = Sxy / √(Sxx Syy), where Sxy = Σ(x − x̄)(y − ȳ).

Worked example

x: 1, 2, 3, 4, 5; y: 2, 4, 5, 4, 5. x̄ = 3, ȳ = 4.
Sxy = (−2)(−2) + (−1)(0) + 0 + (1)(0) + (2)(1) = 6; Sxx = 10; Syy = 4 + 0 + 1 + 0 + 1 = 6.
r = 6/√60 = 0.775: a fairly strong positive link.
Least-squares line: b = Sxy/Sxx = 0.6, a = ȳ − b x̄ = 2.2, so ŷ = 2.2 + 0.6x.
(Checked by computer: r = 0.7746.)

Variance of a sum

Var(aX + bY) = a² Var(X) + b² Var(Y) + 2ab Cov(X, Y). This is how risk in a portfolio or error in a measurement adds up.

Exams usually ask

  • Find marginals from a joint table and test independence.
  • Compute covariance and correlation (population or sample).
  • Fit and interpret a regression line.

Common mistake

Reading correlation as cause. Students who buy more textbooks may score higher, but the cause may be a third factor (time spent studying).

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All MTH 260 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.