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

39.4. QUADRATIC FORMS 821Corollary 39.4.3 Let X1,--- ,X, be a random independent sample from n (0, 0”) and forTx=(% - % )and let {Ag}; be symmetric real matrices. Then the random variables {X TAX yeare independent if and only if AA; = 0 whenever k # j.Recall that for X;,--- ,X;,, independent random variables which are n (u, 0”) , their sumoOvariables { Ae \"i=2ey 5") is 27 (n). As noted, this is a quadratic form in the independent random. You just let the symmetric matrix A be the identity.1T as ve .What about * a* ? When will this be distributed as a 27 (r) random variable? Forsimplicity, assume the random variables are n (0, 0”). It was shown above that the momentgenerating function for X7AX is(det (7-207) '"°)XTAX :7] 1oOM(t)=E (o**) _ («ct (-20° a) *") _ («ety -2ra)~")Of course, it was shown some time ago that the moment generating function for 2°? (r) isoan Let U be an orthogonal matrix such that U7 AU = D, a diagonal matrix. ThusTherefore, the moment generating function of SM (t) = det (I—2rD)~'/?Now if there is anything other than 1 or 0 on the diagonal of D then M (t) cannot possiblybe of the form aay Lets consider why this is. Suppose the diagonal entries of D ared,,:-- ,dy. ThenCh -1/2M(t) = (I - 2a)i=lIf you have a factor (1 — 2td;) for some d; ¢ {0,1}, then it simply does not have the rightform to be the moment generating function for 27 (r). On the other hand, if each d; iseither 0 or 1, then M (ft) 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 X"AX is 2°? (r)? Yes there is.The eigenvalues of the symmetric matrix A are either | or 0.Lemma 39.4.4 Let A be a real symmetric matrix. Then A? = A if and only if the eigenval-ues of A are either 0 or 1.Proof: Suppose the eigenvalues are 0 or |. Since A is symmetric, there is an orthonor-mal basis of eigenvectors. {v,};_, . See Theorem 11.4.7 from the early material on linearalgebra. Then say Av; = Av, either A is 0 or 1 so either Avy = vy; or Av; = O. In thefirst case, A2u; = Av, so (A? —A) v, = 0. In the second case, A2v; = AO = O and so