Cochran's theorem

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

Statement

Let U1,⋯,UN be i.i.d. standard normally distributed random variables, and U=[U1,...,UN]T. Let B(1),B(2),…,B(k) be symmetric matrices. Define ri to be the rank of B(i). Define Qi=UTB(i)U, so that the Qi are quadratic forms. Further assume ∑iQi=UTU.

Cochran's theorem states that the following are equivalent:

Often it's stated as ∑iAi=A, where A is idempotent, and ∑iri=N is replaced by ∑iri=rank⁡(A). But after an orthogonal transform, A=diag⁡(IM,0), and so we reduce to the above theorem. Here, diag denotes the diagonal transform.

Alternative formulation

The following version is often seen when considering linear regression. Suppose that Y∼Nn(0,σ2In) is a standard multivariate normal random vector (here In denotes the n-by-n identity matrix), and if A1,…,Ak are all n-by-n symmetric matrices with ∑i=1kAi=In. Then, on defining ri=rank⁡(Ai), any one of the following conditions implies the other two:

Examples

Sample mean and sample variance

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

Ui=Xi−μσ

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

∑iQi=∑jikUjBjk(i)Uk=∑jkUjUk∑iBjk(i)=∑jkUjUkδjk=∑jUj2

which stems from the original assumption that B1+B2…=I. So instead we will calculate this quantity and later separate it into Qi's. It is possible to write

∑i=1nUi2=∑i=1n(Xi−X‾σ)2+n(X‾−μσ)2

(here X‾ is the sample mean). To see this identity, multiply throughout by σ2 and note that

∑(Xi−μ)2=∑(Xi−X‾+X‾−μ)2

and expand to give

∑(Xi−μ)2=∑(Xi−X‾)2+∑(X‾−μ)2+2∑(Xi−X‾)(X‾−μ).

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

∑(X‾−Xi)=0,

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

∑(Xi−μ)2=∑(Xi−X‾)2+n(X‾−μ)2,

and hence

∑(Xi−μσ)2=∑(Xi−X‾σ)2+n(X‾−μσ)2=∑i(Ui−1n∑jUj)2⏞Q1+1n(∑jUj)2⏞Q2=Q1+Q2.

Now B(2)=Jnn with Jn the matrix of ones which has rank 1. In turn B(1)=In−Jnn given that In=B(1)+B(2). This expression can be also obtained by expanding Q1 in matrix notation. It can be shown that the rank of B(1) is 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.

Distributions

The result for the distributions is written symbolically as

∑(Xi−X‾)2∼σ2χn−12.
n(X‾−μ)2∼σ2χ12,

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

n(X‾−μ)21n−1∑(Xi−X‾)2∼χ121n−1χn−12∼F1,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

σ^2=1n∑(Xi−X‾)2.

Cochran's theorem shows that

nσ^2σ2∼χn−12

and the properties of the chi-squared distribution show that

E(nσ^2σ2)=E(χn−12)nσ2E(σ^2)=(n−1)E(σ^2)=σ2(n−1)n

Proof

Claim: Let X be a standard Gaussian in ℝn, then for any symmetric matrices Q,Q′, if XTQX and XTQ′X have the same distribution, then Q,Q′ have the same eigenvalues (up to multiplicity).

Proof

Let the eigenvalues of Q be λ1,...,λn, then calculate the characteristic function of XTQX. It comes out to be

ϕ(t)=(∏j(1−2iλjt))−1/2

(To calculate it, first diagonalize Q, change into that frame, then use the fact that the characteristic function of the sum of independent variables is the product of their characteristic functions.)

For XTQX and XTQ′X to be equal, their characteristic functions must be equal, so Q,Q′ have the same eigenvalues (up to multiplicity).

Claim: I=∑iBi.

Proof

UT(I−∑iBi)U=0. Since (I−∑iBi) is symmetric, and UT(I−∑iBi)U=dUT0U, by the previous claim, (I−∑iBi) has the same eigenvalues as 0.

Lemma: If ∑iMi=I, all Mi symmetric, and have eigenvalues 0, 1, then they are simultaneously diagonalizable.

Proof

Fix i, and consider the eigenvectors v of Mi such that Miv=v. Then we have vTv=vTIv=vTv+∑j≠ivTMjv. We note that the Mjs are positive semi-definite, since their eigenvectors are all non-negative; so, for all js we must have vTMjv=0. Thus we obtain a split of ℝN into V⊕V⊥, such that the 1-eigenspace V of Mi is contained in the 0-eigenspaces of Mj for j≠i. Now induct by moving into V⊥. If Mi≠0 for all is, then a basis diagonalizing simultaneously each Mi is given by (v1,1,…,vr1,1,…,v1,k,…,vrk,k), where (v1,i,…,vri,i) is a basis of the 1-eigenspace of Mi.

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 (1→2→3→1).

Proof

Case: All Qi are independent

Fix some i, define Ci=I−Bi=∑j≠iBj, and diagonalize Bi by an orthogonal transform O. Then consider OCiOT=I−OBiOT. It is diagonalized as well.

Let W=OU, then it is also standard Gaussian. Then we have

Qi=WT(OBiOT)W;∑j≠iQj=WT(I−OBiOT)W

Inspect their diagonal entries, to see that Qi⊥∑j≠iQj implies that their nonzero diagonal entries are disjoint.

Thus all eigenvalues of Bi are 0, 1, so Qi is a χ2 dist with ri degrees of freedom.

Case: Each Qi is a χ2(ri) distribution.

Fix any i, diagonalize it by orthogonal transform O, and reindex, so that OBiOT=diag(λ1,...,λri,0,...,0). Then Qi=∑jλjU′j2 for some U'j, a spherical rotation of Ui.

Since Qi∼χ2(ri), we get all λj=1. So all Bi⪰0, and have eigenvalues 0,1.

So diagonalize them simultaneously, add them up, to find ∑iri=N.

Case: r1+⋯+rk=N.

We first show that the matrices B(i) can be simultaneously diagonalized by an orthogonal matrix and that their non-zero eigenvalues are all equal to +1. Once that's shown, take this orthogonal transform to this simultaneous eigenbasis, in which the random vector [U1,...,UN]T becomes [U'1,...,U'N]T, but all Ui′ are still independent and standard Gaussian. Then the result follows.

Each of the matrices B(i) has rank ri and thus ri non-zero eigenvalues. For each i, the sum C(i)≡∑j≠iB(j) has at most rank ∑j≠irj=N−ri. Since B(i)+C(i)=IN×N, it follows that C(i) has exactly rank N − ri.

Therefore B(i) and C(i) can be simultaneously diagonalized. This can be shown by first diagonalizing B(i), by the spectral theorem. In this basis, it is of the form:

[λ100⋯⋯00λ20⋯⋯000⋱⋮⋮⋮λri⋮⋮00⋮⋱00…0].

Thus the lower (N−ri) rows are zero. Since C(i)=I−B(i), it follows that these rows in C(i) in this basis contain a right block which is a (N−ri)×(N−ri) unit matrix, with zeros in the rest of these rows. But since C(i) has rank N − ri, it must be zero elsewhere. Thus it is diagonal in this basis as well. It follows that all the non-zero eigenvalues of both B(i) and C(i) are +1. This argument applies for all i, thus all B(i) are positive semidefinite.

Moreover, the above analysis can be repeated in the diagonal basis for C(1)=B(2)+∑j>2B(j). In this basis C(1) is the identity of an (N−r1)×(N−r1) vector space, so it follows that both B(2) and ∑j>2B(j) are simultaneously diagonalizable in this vector space (and hence also together with B(1)). By iteration it follows that all B-s are simultaneously diagonalizable.

Thus there exists an orthogonal matrix S such that for all i, STB(i)S≡B(i)′ is diagonal, where any entry Bx,y(i)′ with indices x=y, ∑j=1i−1rj<x=y≤∑j=1irj, is equal to 1, while any entry with other indices is equal to 0.


See also