Study Vault Search notes, aliases and full text
Graph
ConceptProbability and Statistics used inMSIAI-written · not yet proofread

Covariance

Also Kovarianz

The covariance σ(Y, Z) = E{(Y − μ_Y)(Z − μ_Z)} of two scalar random variables measures how they vary together; its unit is the product of their units.

Know these firstExpected ValueVariance

Formula#

σ(Y,Z)=E{YZ}−μYμZ\sigma(Y, Z) = \mathbb{E}\{YZ\} - \mu_Y\mu_Z

(expand the product and use linearity, as for the Variance).

Properties#

  • Symmetric, and σ(Y,Y)=σY2\sigma(Y, Y) = \sigma_Y^2.
  • Units: the product of the units of YY and ZZ. Dividing by σYσZ\sigma_Y\sigma_Z gives the unitless Correlation.
  • Independent ⇒ zero covariance: for independent YY, ZZ, E{YZ}=μYμZ\mathbb{E}\{YZ\} = \mu_Y\mu_Z, so σ(Y,Z)=0\sigma(Y, Z) = 0. The converse is false.
  • Bilinear: σ(a+bY,c+dZ)=bd σ(Y,Z)\sigma(a + bY, c + dZ) = bd\,\sigma(Y, Z).
  • Vector form: all variances and covariances of a random vector are collected in the Covariance Matrix, with entries (ΣX)jk=σ(Xj,Xk)(\Sigma_X)_{jk} = \sigma(X_j, X_k).

Example#

Intuition#

prob covariance weighting
Every point (y,z)(y, z) of the plane contributes the product of its offsets from the means, (y−μY)(z−μZ)(y - \mu_Y)(z - \mu_Z). The product is positive in the upper-right and lower-left quadrant around (μY,μZ)(\mu_Y, \mu_Z) and negative in the other two (left). The joint PDF weights each contribution by how much probability lies near that point (middle). The covariance is the volume under the weighted product (right): red volume minus blue volume. A joint PDF stretched along the rising diagonal puts most of its mass into the ++ quadrants, so σ(Y,Z)>0\sigma(Y, Z) > 0. Along the falling diagonal, σ(Y,Z)<0\sigma(Y, Z) < 0.

prob covariance marginals
Looking at the joint PDF from the side gives the PDF of one variable, the marginal pY(y)=∫pY,Z(y,z) dzp_Y(y) = \int p_{Y,Z}(y, z)\,\mathrm{d}z. “From the side” means adding up everything along the line of sight, like an X-ray, not the outline of the surface. For a normal distribution both have the same shape; in general they don’t. The marginals don’t determine the covariance: tilting the surface (changing ρ\rho) leaves both marginals unchanged. The covariance lives in the joint PDF only.

prob covariance samples
N=400N = 400 samples of (Y,Z)(Y, Z) from a bivariate normal distribution with σY=σZ=1\sigma_Y = \sigma_Z = 1, so σ(Y,Z)=ρ\sigma(Y, Z) = \rho (Correlation). Red points have a positive offset product, blue ones a negative. The sample covariance 1N∑k=1N(yk−yˉ)(zk−zˉ)\frac1N \sum_{k=1}^N (y_k - \bar y)(z_k - \bar z), with sample means yˉ\bar y, zˉ\bar z, is the same weighting with the PDF replaced by the points: a rising cloud has mostly red points, a falling one mostly blue, and a round cloud about as many of each.

prob covariance zero dependent
Zero covariance does not mean independence. Left: Z=Y2Z = Y^2 with Y∼N(0,1)Y \sim \mathcal{N}(0, 1), so ZZ is fully determined by YY. But every point (y,y2)(y, y^2) has an equally likely mirror point (−y,y2)(-y, y^2) with the opposite product, so the quadrants cancel: σ(Y,Z)=E{Y⋅Y2}−μYμZ=E{Y3}−0=0\sigma(Y, Z) = \mathbb{E}\{Y \cdot Y^2\} - \mu_Y\mu_Z = \mathbb{E}\{Y^3\} - 0 = 0. Right: points on a circle, σ(Y,Z)=0\sigma(Y, Z) = 0 by symmetry. Covariance only measures how much the joint PDF leans along a straight line.

Sources#

  • MSI script pp. 15–16 (§2.2.4), MSI Slides 02 > 2.2.4 Covariance and Correlation (not published)
  • MSI script p. 17 (example: covariance of the sample mean and a single measurement), MSI Slides 02 > 2.4 Statistical Estimators (not published)

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only