← Moment Equations

03

Second moments, variance and covariance

The mean describes centre; second moments describe spread and joint variation between biological quantities.

Why the mean is insufficient

Two epidemic distributions can have the same mean infectious count but very different spreads. The second raw moment is \(\mathbb E[X^2]\), while variance is

\[\operatorname{Var}(X)=\mathbb E[X^2]-(\mathbb E[X])^2.\]

Variance is measured in squared units; standard deviation is its square root and uses the original units.

Covariance connects two variables

\[\operatorname{Cov}(X,Y)=\mathbb E[XY]-\mathbb E[X]\mathbb E[Y].\]

Positive covariance means above-average values tend to occur together. Negative covariance means one tends to be above average when the other is below average. Zero covariance does not generally prove independence.

Biological scenario

For an SIR epidemic, record susceptible and infectious populations on day 25. Infection transfers people from \(S\) to \(I\), so the two quantities may be negatively associated across epidemic histories.

Interactive Python laboratory

Interactive PythonSecond moments and covariance

Output

Run the code to see the result.

Raw moment versus central moment

QuantityCentred?Purpose
\(\mathbb E[X^2]\)NoSecond raw moment used in moment equations.
\(\operatorname{Var}(X)\)YesSpread around the mean.
\(\mathbb E[XY]\)NoMixed raw moment.
\(\operatorname{Cov}(X,Y)\)YesJoint variation around both means.

What this lesson adds

You can now distinguish second raw moments from variance, calculate covariance and correlation from paired epidemic samples, and interpret their biological signs without claiming that covariance proves causation.