556 Inferences About Normal Linear Modelsquadratic forminX. Due to the symmetry ofA, there are several ways we can
writeQ:
Q=X′AX =∑ni=1∑nj=1aijXiXj=∑ni=1aiiXi^2 +∑∑i =jaijXiXj (9.8.4)=∑ni=1aiiXi^2 +2∑∑i<jaijXiXj.(9.8.5)These are very useful random variables in analysis of variance models. As the
following theorem shows, the mean of a quadratic form is easily obtained.Theorem 9.8.1.Suppose then-dimensional random vectorXhas meanμand
variance–covariance matrixΣ.LetQ=X′AX,whereAis a realn×nsymmetric
matrix. Then
E(Q)=trAΣ+μ′Aμ. (9.8.6)
Proof:Using the trace operator and property (9.8.3), we haveE(Q)=E(trX′AX)=E(trAXX′)
=trAE(XX′)
=trA(Σ+μμ′)
=trAΣ+μ′Aμ,where the third line follows from Theorem 2.6.3.Example 9.8.1(Sample Variance). LetX′=(X 1 ,...,Xn)beann-dimensional
vector of random variables. Let 1 ′=(1,...,1) be then-dimensional vector whose
components are 1. LetIbe then×nidentity matrix. Consider the quadratic form
Q=X′(I−n^1 J)X,whereJ= 11 ′; i.e.,Jis ann×nmatrix with all entries equal
to 1. Note that the off-diagonal entries of (I−^1 n,J)are−n−^1 while the diagonal
entries are 1−n−^1 ; hence, by (9.8.4),Qsimplifies to
Q =∑ni=1Xi^2(
1 −1
n)
+∑∑i =j(
−1
n)
XiXj=∑ni=1Xi^2(
1 −1
n)
−1
n∑ni=1Xi∑nj=1Xj+1
n∑ni=1X^2 i=∑ni=1Xi^2 −nX
2
=(n−1)S^2 , (9.8.7)whereXandS^2 denote the sample mean and variance ofX 1 ,...,Xn.
Suppose we further assume thatX 1 ,...,Xnare iid random variables with com-
mon meanμand varianceσ^2. Using Theorem 9.8.1, we can obtain yet another