Why Compare Restricted and Unrestricted Fits?
A linear hypothesis asks whether a model can be simplified without losing too much fit. For example, a researcher may ask whether several regression coefficients are zero or whether two coefficients satisfy a specified linear relation. Least squares makes this comparison concrete: fit the model with no restrictions, fit it again subject to the hypothesis, and measure how much the residual sum of squares increases.
The increase is not merely a descriptive difference. Under normal errors, its size relative to the unrestricted residual variation gives an exact test of the restrictions. This tutorial derives that increase and establishes the distributional connection needed for the test.
Unrestricted and Restricted Least Squares
Consider the fixed-design linear model \(Y=X\beta+\varepsilon\), where \(Y\) is an \(n\)-vector, \(X\) is a fixed \(n\times p\) matrix of full column rank, and \(\beta\) is a \(p\)-vector. Assume \(n>p\). The unrestricted least-squares estimator minimizes the residual sum of squares over all coefficient vectors. A restricted fit minimizes the same quantity, but only over vectors satisfying a stated linear hypothesis.
The restrictions are independent because \(R\) has rank \(q\). With \(X\) full column rank and \(R\) of full row rank, the matrix \(R(X'X)^{-1}R'\) is invertible. Any specified \(r\) is feasible: a full-row-rank \(R\) maps onto \(\mathbb{R}^q\).
Deriving the Increase in Residual Sum of Squares
Write \(A=X'X\) and \(d=R\hat{\beta}-r\), the amount by which the unrestricted estimate fails to satisfy the restrictions. For any candidate coefficient vector \(b=\hat{\beta}+\delta\), the normal equations \(X'(Y-X\hat{\beta})=0\) give
Thus, among candidates satisfying the restrictions, the restricted fit is the adjustment \(\delta\) of minimum \(A\)-weighted squared length subject to \(R\delta=-d\). The following derivation solves that constrained minimization explicitly.
Minimize \(\delta'A\delta\) subject to \(R\delta+d=0\). The matrix \(A\) is positive definite because \(X\) has full column rank.
For multiplier vector \(\lambda\), the first-order equation for \(\delta'A\delta+2\lambda'(R\delta+d)\) is \(A\delta+R'\lambda=0\). Hence \(\delta=-A^{-1}R'\lambda\).
Substitution into \(R\delta=-d\) gives \(\lambda=\{RA^{-1}R'\}^{-1}d\), and therefore \(\delta=-A^{-1}R'\{RA^{-1}R'\}^{-1}d\).
Substitution into \(\delta'A\delta\) gives the increase in residual sum of squares.
To verify the last step directly, let \(M=RA^{-1}R'\). The minimizing adjustment is \(\delta=-A^{-1}R'M^{-1}d\). Therefore $$ \delta'A\delta=d'M^{-1}RA^{-1}AA^{-1}R'M^{-1}d =d'M^{-1}MM^{-1}d=d'M^{-1}d. $$ Since \(M\) is positive definite, the increase is nonnegative, and it is zero exactly when \(R\hat{\beta}=r\). This also follows from the fact that the unrestricted fit minimizes RSS over a larger set than the restricted fit.
Worked Least-Squares Comparisons
Worked Example: Two Zero Restrictions in an Orthogonal Design
Let \(X\) have three columns \(x_1=(1,1,1,1)'\), \(x_2=(1,-1,1,-1)'\), and \(x_3=(1,1,-1,-1)'\), and let \(Y=(4,2,0,2)'\). Impose the two restrictions \(\beta_2=0\) and \(\beta_3=0\).
The columns are mutually orthogonal and each has squared length 4, so \(X'X=4I_3\). The three inner products with \(Y\) are \(x_1'Y=8\), \(x_2'Y=0\), and \(x_3'Y=4\). Consequently \(\hat{\beta}=(2,0,1)'\). The unrestricted fitted values are \(2x_1+x_3=(3,3,1,1)'\), so the residuals are \((1,-1,-1,1)'\) and \(\operatorname{RSS}_U=4\).
Under the restrictions, only \(\beta_1\) can vary. Its least-squares value is \(x_1'Y/(x_1'x_1)=8/4=2\). The restricted fitted values are \((2,2,2,2)'\), and the residuals are \((2,0,-2,0)'\). Thus \(\operatorname{RSS}_R=4+0+4+0=8\), an increase of 4.
For the formula, take \(R\) to select \(\beta_2\) and \(\beta_3\), with \(r=(0,0)'\). Then \(R\hat{\beta}-r=(0,1)'\) and \(R(X'X)^{-1}R'=\tfrac14 I_2\). The formula gives \((0,1)(4I_2)(0,1)'=4\), matching the direct calculation.
Worked Example: Removing One Nonzero Coefficient
Let \(x_1=(1,1,1)'\), \(x_2=(1,0,-1)'\), and \(Y=(3,1,1)'\). Test the restriction \(\beta_2=0\).
Here \(x_1'x_1=3\), \(x_2'x_2=2\), and \(x_1'x_2=0\). Also \(x_1'Y=5\) and \(x_2'Y=2\), so \(\hat{\beta}=(5/3,1)'\). The unrestricted fitted vector is \((8/3,5/3,2/3)'\), giving residuals \((1/3,-2/3,1/3)'\) and \(\operatorname{RSS}_U=1/9+4/9+1/9=2/3\).
With \(\beta_2=0\), the restricted estimate of \(\beta_1\) is still \(5/3\), and the fitted values are \((5/3,5/3,5/3)'\). The residuals are \((4/3,-2/3,-2/3)'\), so \(\operatorname{RSS}_R=16/9+4/9+4/9=8/3\). The increase is \(8/3-2/3=2\).
For this one-row \(R=(0,1)\), the discrepancy is \(R\hat{\beta}=1\), and \(R(X'X)^{-1}R'=1/2\). The formula gives \(1^2/(1/2)=2\), as required.
Worked Example: A Nonorthogonal Linear Restriction
Take the four rows of \(X\) to be \((1,0),(0,1),(1,1),(0,1)\), and let \(Y=(3,2,2,1)'\). Impose \(\beta_1+\beta_2=0\).
The matrix \(X'X\) is \(\begin{pmatrix}2&1\\1&3\end{pmatrix}\), with inverse \(\tfrac15\begin{pmatrix}3&-1\\-1&2\end{pmatrix}\). Also \(X'Y=(5,5)'\), so \(\hat{\beta}=(2,1)'\). The unrestricted fitted values are \((2,1,3,1)'\); the residual vector is \((1,1,-1,0)'\), and \(\operatorname{RSS}_U=3\).
Here \(R=(1,1)\), \(r=0\), and \(R\hat{\beta}-r=3\). The scalar \(R(X'X)^{-1}R'\) is \((3-1-1+2)/5=3/5\). Therefore the increase is \(3^2/(3/5)=15\).
The restricted coefficient formula gives \(\hat{\beta}_R=(2,1)'-\tfrac15(2,1)'(5/3)(3)=(0,0)'\). Its fitted vector is zero, so \(\operatorname{RSS}_R=Y'Y=9+4+4+1=18\). The direct increase \(18-3=15\) agrees with the formula.
From the Increase to an Exact F Test
Now assume the errors are Gaussian and spherical: \(\varepsilon\sim N(0,\sigma^2 I_n)\), where \(\sigma^2>0\). Under the null hypothesis \(H_0:R\beta=r\), the restriction increase, divided by \(\sigma^2\), has a chi-square distribution with \(q\) degrees of freedom. The unrestricted residual sum of squares, divided by \(\sigma^2\), has a chi-square distribution with \(n-p\) degrees of freedom, and these two quantities are independent.
To see why, write \(C=\operatorname{col}(X)\) for the unrestricted fitted-value space and \(S=\{Xb:Rb=0\}\) for the directions available within the restricted model. Under \(H_0\), the restricted affine fitted-value space passes through the true mean \(X\beta\) and has direction space \(S\), of dimension \(p-q\). The space \(C\) is the orthogonal direct sum of \(S\) and \(D=C\cap S^\perp\), where \(D\) has dimension \(q\). The unrestricted residual is the projection of \(\varepsilon\) onto \(C^\perp\); the difference between the restricted and unrestricted residual sums of squares is the squared length of the projection onto \(D\).
Choose orthonormal bases for \(D\) and \(C^\perp\). Their coordinates of \(\varepsilon\) are independent \(N(0,\sigma^2)\) variables because the error vector is Gaussian with covariance \(\sigma^2 I_n\), and the two spaces are orthogonal. The squared coordinates in \(D\), divided by \(\sigma^2\), sum to \(\chi^2_q\); those in \(C^\perp\), divided by \(\sigma^2\), sum to \(\chi^2_{n-p}\). The sums are independent. This proves the stated distribution and independence.
The denominator is the unrestricted residual mean square, an estimator of \(\sigma^2\). The numerator is the increase per independent restriction. Large values indicate that enforcing the restrictions costs substantial fit relative to the remaining residual variation. The exact calibration applies under the null and the stated Gaussian model assumptions.
For the nonorthogonal example above, \(q=1\), \(n-p=2\), the increase is 15, and the unrestricted residual mean square is \(3/2\). Thus \(F=(15/1)/(3/2)=10\), calibrated under the null by an \(F_{1,2}\) distribution. This calculation connects the fitted-model comparison directly to the hypothesis test.
Common Mistake: Reversing the RSS Difference
A frequent error is to subtract in the opposite order and expect the result to be positive. Since the unrestricted model permits every coefficient vector allowed by the restricted model, minimizing over the unrestricted set cannot produce a larger residual sum of squares. Thus \(\operatorname{RSS}_R-\operatorname{RSS}_U\geq 0\), not the reverse. A negative difference signals either a reversed subtraction or an incorrectly computed fit.
Another mistake is to compare the raw increase with a universal cutoff. Its scale depends on \(\sigma^2\), and the number of restrictions matters. The F statistic accounts for both by dividing the increase by \(q\) and comparing it with the unrestricted residual mean square. Finally, only independent restrictions contribute degrees of freedom: redundant rows in \(R\) must not be counted as additional restrictions.
Check Your Understanding
Use the definitions and derivations above to answer the following questions.
- Why must \(\operatorname{RSS}_R-\operatorname{RSS}_U\) be nonnegative, even before using its matrix formula?
- For a rank-\(q\) restriction, identify the numerator and denominator degrees of freedom in the exact F statistic.
- If \(R\hat{\beta}=r\), what does the increase formula imply about the two fitted models?
- In the second worked example, explain why \(R(X'X)^{-1}R'=1/2\) and how it leads to an increase of 2.
- Which assumptions are needed for the F calibration, beyond being able to compute the two least-squares fits?