Why the Mean Component Matters
A squared projection of a standard Gaussian vector onto an \(r\)-dimensional subspace is a sum of \(r\) independent squared standard normal variables, so it has a central chi-square distribution with \(r\) degrees of freedom. If the Gaussian vector has a nonzero mean, the projected coordinates are shifted. The resulting sum of squares is generally noncentral chi-square. Its noncentrality parameter measures the squared size of the mean component that lies in the subspace—not the squared size of the entire mean vector.
This distinction is useful when a quadratic form represents a sum of squares in selected directions, such as a fitted or contrast subspace. The geometry identifies both the degrees of freedom and the part of the mean that affects the distribution.
Definition and Projection Setup
Consider a Gaussian vector \(X\sim N_p(\mu,I_p)\), where \(I_p\) is the \(p\times p\) identity matrix. Let \(P\) be the orthogonal projection matrix onto a subspace of dimension \(r\). Thus \(P=P'\), \(P^2=P\), and \(\operatorname{rank}(P)=r\). The squared length of the projected vector is \(Q=X'PX=\|PX\|^2\).
The rank determines the number of projected coordinates and therefore the degrees of freedom. The noncentrality parameter is the squared length of the projection of \(\mu\), because \(P\mu\) is the mean vector in the directions retained by the projection.
Proof in Orthonormal Coordinates
Choose a \(p\times r\) matrix \(U\) whose columns form an orthonormal basis for the subspace onto which \(P\) projects. Then \(U'U=I_r\) and \(P=UU'\). Extend those columns to an orthonormal basis of \(\mathbb{R}^p\), giving an orthogonal matrix \(O\) whose first \(r\) columns are the columns of \(U\).
Write \(Z=X-\mu\), so \(Z\sim N_p(0,I_p)\). The density of \(Z\) is proportional to \(\exp(-z'z/2)\). Since an orthogonal transformation preserves \(z'z\) and has absolute Jacobian determinant \(1\), \(O'Z\sim N_p(0,I_p)\). Its coordinates are independent standard normals.
The first \(r\) coordinates of \(O'X\) are \(U'X=U'\mu+U'Z\). Thus they are independent normal variables with unit variance and mean components given by \(U'\mu\).
Because \(P=UU'\), \(X'PX=X'UU'X=\|U'X\|^2\). This is the sum of the squares of the \(r\) independent normal coordinates from Step 2.
The sum of squared coordinate means is \((U'\mu)'(U'\mu)=\mu'UU'\mu=\mu'P\mu=\|P\mu\|^2\). By the definition of a noncentral chi-square variable, the claimed distribution follows. \(\square\)
This proof also shows why a particular choice of basis does not affect the answer. The basis changes the list of projected mean coordinates, but not their total squared length \(\|P\mu\|^2\).
Worked Examples
Worked Example: A Rank-Two Projection in Three Dimensions
Let \(X\sim N_3(\mu,I_3)\), with \(\mu=(1,2,-1)'\). Project onto the plane spanned by the orthonormal vectors \(u=(1,1,0)'/\sqrt{2}\) and \(v=(0,0,1)'\). Find the distribution of the squared projected length.
The projection matrix is \(P=uu'+vv'\). For any \(x=(x_1,x_2,x_3)'\), its projected coordinates along \(u\) and \(v\) are \((x_1+x_2)/\sqrt{2}\) and \(x_3\). Therefore
The rank is \(2\), so the degrees of freedom are \(2\). The mean coordinates in the plane are
Consequently,
Thus \(X'PX\sim\chi^2_2(11/2)\). The result uses only the mean components within the plane; the projection discards the direction perpendicular to it.
Worked Example: A One-Dimensional Contrast
Let \(X\sim N_3((2,1,4)',I_3)\), and project onto the line spanned by \(u=(1,-1,0)'/\sqrt{2}\). Find the law of the squared projected length.
The projection is \(P=uu'\), which has rank \(1\). Hence \(X'PX=(u'X)^2=(X_1-X_2)^2/2\). The mean of the projected coordinate is
Its squared value is the noncentrality parameter:
Therefore \(X'PX\sim\chi^2_1(1/2)\). The third component of \(\mu\) has no effect because the chosen line has zero third coordinate.
Worked Example: A Nonzero Mean Can Still Give a Central Law
Let \(X\sim N_3((0,0,5)',I_3)\), and project onto the plane spanned by the first two coordinate axes. The projection matrix is \(P=\operatorname{diag}(1,1,0)\), with rank \(2\). The quadratic form is \(X'PX=X_1^2+X_2^2\).
The projected mean is \(P\mu=(0,0,0)'\), even though \(\mu\) itself is nonzero. Thus
It follows that \(X'PX\sim\chi^2_2\), a central chi-square distribution. The mean lies entirely outside the projected subspace, so it does not shift either retained coordinate.
Moment-Generating Function and Moments
The defining representation gives a direct check on the parameterization. For a standard normal \(G\), a fixed real \(a\), and \(t<1/2\), completing the square in the normal density gives
For the second equality, the exponent is a quadratic in \(g\) with coefficient \(-(1-2t)/2\). Since \(t<1/2\), its integral is finite; shifting the integration variable to complete the square yields the displayed normal integral. Applying this expression to the independent coordinates and multiplying their moment-generating functions gives the following result.
For completeness, the mean and variance can be obtained directly from the defining sum. For each term, \(E[(G_i+a_i)^2]=1+a_i^2\). Also, using \(E[G_i]=E[G_i^3]=0\), \(E[G_i^2]=1\), and \(E[G_i^4]=3\), expansion gives \(\operatorname{Var}((G_i+a_i)^2)=2+4a_i^2\). The terms are independent, so their means and variances add:
For the projected Gaussian quadratic form, these become \(E[X'PX]=r+\mu'P\mu\) and \(\operatorname{Var}(X'PX)=2r+4\mu'P\mu\). In particular, a nonzero projected mean raises both the mean and the variance relative to the central case.
When Covariance Is a Scalar Multiple of the Identity
If \(X\sim N_p(\mu,\sigma^2 I_p)\) with \(\sigma>0\), the same result applies after dividing by \(\sigma\). Indeed, \(X/\sigma\sim N_p(\mu/\sigma,I_p)\), and
The scaling is essential: \(X'PX\) itself is \(\sigma^2\) times a noncentral chi-square variable, not generally a noncentral chi-square variable in the unit-scale convention used here. For a general covariance matrix, the conclusion does not follow just by inserting that covariance into this formula; the projected coordinates need not have identity covariance.
Common Mistake: Using the Entire Mean
A tempting but incorrect calculation is to set the noncentrality parameter equal to \(\mu'\mu\) whenever \(\mu\ne 0\). The error is that \(X'PX\) only measures components in the range of \(P\). The correct calculation is
not \(\mu'\mu\). For example, in the third worked example, \(\mu'\mu=25\), but \(P\mu=0\) and the actual noncentrality parameter is \(0\). Compute the projected mean first; then square its length.
Check Your Understanding
Use the projection matrix and the projected mean to answer each question.
- If \(X\sim N_4(\mu,I_4)\) and \(P\) projects onto a three-dimensional subspace, what determines the degrees of freedom of \(X'PX\)?
- For a projection matrix \(P\), explain why \(\mu'P\mu=\|P\mu\|^2\).
- Suppose \(P=\operatorname{diag}(1,0,0)\) and \(\mu=(0,3,4)'\). What is the noncentrality parameter, and is the projected quadratic form central or noncentral?
- If \(X\sim N_p(\mu,\sigma^2 I_p)\), what scaling gives a noncentral chi-square variable, and what is its noncentrality parameter?
- For \(W\sim\chi^2_r(\lambda)\), state its mean and variance and describe how both differ from the central case when \(\lambda>0\).