Cochran's theorem

In statistics, Cochran's theorem, devised by William G. Cochran,[1] is a theorem used to justify results relating to the probability distributions of statistics that are used in the analysis of variance.[2]

Statement

Let U1, ..., UN be i.i.d. standard normally distributed random variables, and $\displaystyle{ U = [U_1, ..., U_N]^T }$. Let $\displaystyle{ B^{(1)},B^{(2)},\ldots, B^{(k)} }$be symmetric matrices. Define ri to be the rank of $\displaystyle{ B^{(i)} }$. Define $\displaystyle{ Q_i=U^T B^{(i)}U }$, so that the Qi are quadratic forms. Further assume $\displaystyle{ \sum_i Q_i = U^T U }$.

Cochran's theorem states that the following are equivalent:

Often it's stated as $\displaystyle{ \sum_i A_i = A }$, where $\displaystyle{ A }$ is idempotent, and $\displaystyle{ \sum_i r_i = N }$ is replaced by $\displaystyle{ \sum_i r_i = rank(A) }$. But after an orthogonal transform, $\displaystyle{ A = diag(I_M, 0) }$, and so we reduce to the above theorem.

Proof

Claim: Let $\displaystyle{ X }$ be a standard Gaussian in $\displaystyle{ \R^n }$, then for any symmetric matrices $\displaystyle{ Q, Q' }$, if $\displaystyle{ X^T Q X }$ and $\displaystyle{ X^T Q' X }$ have the same distribution, then $\displaystyle{ Q, Q' }$ have the same eigenvalues (up to multiplicity).

Claim: $\displaystyle{ I = \sum_i B_i }$.

Lemma: If $\displaystyle{ \sum_i M_i = I }$, all $\displaystyle{ M_i }$ symmetric, and have eigenvalues 0, 1, then they are simultaneously diagonalizable.

Now we prove the original theorem. We prove that the three cases are equivalent by proving that each case implies the next one in a cycle ($\displaystyle{ 1 \to 2 \to 3 \to 1 }$).

Examples

Sample mean and sample variance

If X1, ..., Xn are independent normally distributed random variables with mean μ and standard deviation σ then

$\displaystyle{ U_i = \frac{X_i-\mu}{\sigma} }$

is standard normal for each i. Note that the total Q is equal to sum of squared Us as shown here:

$\displaystyle{ \sum_iQ_i=\sum_{jik} U_j B_{jk}^{(i)} U_k = \sum_{jk} U_j U_k \sum_i B_{jk}^{(i)} = \sum_{jk} U_j U_k\delta_{jk} = \sum_{j} U_j^2 }$

which stems from the original assumption that $\displaystyle{ B_{1} + B_{2} \ldots = I }$. So instead we will calculate this quantity and later separate it into Qi's. It is possible to write

$\displaystyle{ \sum_{i=1}^n U_i^2=\sum_{i=1}^n\left(\frac{X_i-\overline{X}}{\sigma}\right)^2 + n\left(\frac{\overline{X}-\mu}{\sigma}\right)^2 }$

(here $\displaystyle{ \overline{X} }$ is the sample mean). To see this identity, multiply throughout by $\displaystyle{ \sigma^2 }$ and note that

$\displaystyle{ \sum(X_i-\mu)^2= \sum(X_i-\overline{X}+\overline{X}-\mu)^2 }$

and expand to give

$\displaystyle{ \sum(X_i-\mu)^2= \sum(X_i-\overline{X})^2+\sum(\overline{X}-\mu)^2+ 2\sum(X_i-\overline{X})(\overline{X}-\mu). }$

The third term is zero because it is equal to a constant times

$\displaystyle{ \sum(\overline{X}-X_i)=0, }$

and the second term has just n identical terms added together. Thus

$\displaystyle{ \sum(X_i-\mu)^2 = \sum(X_i-\overline{X})^2+n(\overline{X}-\mu)^2 , }$

and hence

$\displaystyle{ \sum\left(\frac{X_i-\mu}{\sigma}\right)^2= \sum\left(\frac{X_i-\overline{X}}{\sigma}\right)^2 +n\left(\frac{\overline{X}-\mu}{\sigma}\right)^2= \overbrace{\sum_i\left(U_i-\frac{1}{n}\sum_j{U_j}\right)^2}^{Q_1} +\overbrace{\frac{1}{n}\left(\sum_j{U_j}\right)^2}^{Q_2}= Q_1+Q_2. }$

Now $\displaystyle{ B^{(2)}=\frac{J_n}{n} }$ with $\displaystyle{ J_n }$ the matrix of ones which has rank 1. In turn $\displaystyle{ B^{(1)}= I_n-\frac{J_n}{n} }$ given that $\displaystyle{ I_n=B^{(1)}+B^{(2)} }$. This expression can be also obtained by expanding $\displaystyle{ Q_1 }$ in matrix notation. It can be shown that the rank of $\displaystyle{ B^{(1)} }$ is $\displaystyle{ n-1 }$ as the addition of all its rows is equal to zero. Thus the conditions for Cochran's theorem are met.

Cochran's theorem then states that Q1 and Q2 are independent, with chi-squared distributions with n − 1 and 1 degree of freedom respectively. This shows that the sample mean and sample variance are independent. This can also be shown by Basu's theorem, and in fact this property characterizes the normal distribution – for no other distribution are the sample mean and sample variance independent.[4]

Distributions

The result for the distributions is written symbolically as

$\displaystyle{ \sum\left(X_i-\overline{X}\right)^2 \sim \sigma^2 \chi^2_{n-1}. }$
$\displaystyle{ n(\overline{X}-\mu)^2\sim \sigma^2 \chi^2_1, }$

Both these random variables are proportional to the true but unknown variance σ2. Thus their ratio does not depend on σ2 and, because they are statistically independent. The distribution of their ratio is given by

$\displaystyle{ \frac{n\left(\overline{X}-\mu\right)^2} {\frac{1}{n-1}\sum\left(X_i-\overline{X}\right)^2}\sim \frac{\chi^2_1}{\frac{1}{n-1}\chi^2_{n-1}} \sim F_{1,n-1} }$

where F1,n − 1 is the F-distribution with 1 and n − 1 degrees of freedom (see also Student's t-distribution). The final step here is effectively the definition of a random variable having the F-distribution.

Estimation of variance

To estimate the variance σ2, one estimator that is sometimes used is the maximum likelihood estimator of the variance of a normal distribution

$\displaystyle{ \widehat{\sigma}^2= \frac{1}{n}\sum\left( X_i-\overline{X}\right)^2. }$

Cochran's theorem shows that

$\displaystyle{ \frac{n\widehat{\sigma}^2}{\sigma^2}\sim\chi^2_{n-1} }$

and the properties of the chi-squared distribution show that

\displaystyle{ \begin{align} E \left(\frac{n \widehat{\sigma}^2}{\sigma^2}\right) &= E \left(\chi^2_{n-1}\right) \\ \frac{n}{\sigma^2}E \left(\widehat{\sigma}^2\right) &= (n-1) \\ E \left(\widehat{\sigma}^2\right) &= \frac{\sigma^2 (n-1)}{n} \end{align} }

Alternative formulation

The following version is often seen when considering linear regression.[5] Suppose that $\displaystyle{ Y\sim N_n(0,\sigma^2I_n) }$ is a standard multivariate normal random vector (here $\displaystyle{ I_n }$ denotes the n-by-n identity matrix), and if $\displaystyle{ A_1,\ldots,A_k }$ are all n-by-n symmetric matrices with $\displaystyle{ \sum_{i=1}^kA_i=I_n }$. Then, on defining $\displaystyle{ r_i= \operatorname{Rank}(A_i) }$, any one of the following conditions implies the other two:

• $\displaystyle{ \sum_{i=1}^kr_i=n , }$
• $\displaystyle{ Y^TA_iY\sim\sigma^2\chi^2_{r_i} }$ (thus the $\displaystyle{ A_i }$ are positive semidefinite)
• $\displaystyle{ Y^TA_iY }$ is independent of $\displaystyle{ Y^TA_jY }$ for $\displaystyle{ i\neq j . }$