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
Variance is measured in squared units; standard deviation is its square root and uses the original units.
Covariance connects two variables
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
Output
Run the code to see the result.
Raw moment versus central moment
| Quantity | Centred? | Purpose |
|---|---|---|
| \(\mathbb E[X^2]\) | No | Second raw moment used in moment equations. |
| \(\operatorname{Var}(X)\) | Yes | Spread around the mean. |
| \(\mathbb E[XY]\) | No | Mixed raw moment. |
| \(\operatorname{Cov}(X,Y)\) | Yes | Joint 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.