39.4. QUADRATIC FORMS 821
Corollary 39.4.3 Let X1, · · · ,Xn be a random independent sample from n(0,σ2
)and for
X ≡(
X1 · · · Xn
)T
and let {Ak}mk=1 be symmetric real matrices. Then the random variables
{XT AkX
}mk=1
are independent if and only if AkA j = 0 whenever k ̸= j.
Recall that for X1, · · · ,Xn independent random variables which are n(µ,σ2
), their sum
∑ni=1
(Xi−µ
σ
)2is X 2 (n). As noted, this is a quadratic form in the independent random
variables{
Xi−µ
σ
}n
i=1. You just let the symmetric matrix A be the identity.
What about XT AXσ2 ? When will this be distributed as a X 2 (r) random variable? For
simplicity, assume the random variables are n(0,σ2
). It was shown above that the moment
generating function for XT AX is(det(I−2σ
2tA)−1/2
)Therefore, the moment generating function of XT AX
σ2 is
M (t)≡ E(
et XT AXσ2
)=
(det(
I−2σ2 t
σ2 A)−1/2
)=(
det(I−2tA)−1/2)
Of course, it was shown some time ago that the moment generating function for X 2 (r) is1
(1−2t)r/2 . Let U be an orthogonal matrix such that UT AU = D, a diagonal matrix. Thus
M (t) = det(I−2tD)−1/2
Now if there is anything other than 1 or 0 on the diagonal of D then M (t) cannot possiblybe of the form 1
(1−2t)r/2 . Lets consider why this is. Suppose the diagonal entries of D are
d1, · · · ,dn. Then
M (t) =
(n
∏i=1
(1−2tdi)
)−1/2
If you have a factor (1−2tdi) for some di /∈ {0,1} , then it simply does not have the rightform to be the moment generating function for X 2 (r). On the other hand, if each di iseither 0 or 1, then M (t) will have the right form and the r will be the number of eigenvaluesequal to 1, the rank of A.
Is there a simple way to describe this condition that XT AX is X 2 (r)? Yes there is.The eigenvalues of the symmetric matrix A are either 1 or 0.
Lemma 39.4.4 Let A be a real symmetric matrix. Then A2 = A if and only if the eigenval-ues of A are either 0 or 1.
Proof: Suppose the eigenvalues are 0 or 1. Since A is symmetric, there is an orthonor-mal basis of eigenvectors. {vk}n
k=1 . See Theorem 11.4.7 from the early material on linearalgebra. Then say Avk = λvk either λ is 0 or 1 so either Avk = vk or Avk = 0. In thefirst case, A2vk = Avk so
(A2−A
)vk = 0. In the second case, A2vk = A0 = 0 and so