Is it true that $X(X'X)^{-1}X'-J/n$ is idempotent, where $J$ is an $n$ by $n$ matrix of ones?

951 Views Asked by At

$X$ is a full column rank $n$ by $p$ matrix with the first column a vector of ones. Now the I was trying to prove, from a different approach that the SSR/variance is Chi square but this means I have to show that $X(X'X)^{-1}X'-J/n$ is idempotent which I cant seem to show.

1

There are 1 best solutions below

0
On

Note that $J/n$ is a projection, and so is $X(X'X)^{-1}X'$. Since $$\operatorname{Tr}(X(X'X)^{-1}X')=\operatorname{Tr}((X'X)^{-1}X'X)=\operatorname{Tr}(I_n)=n,$$ we have that $X(X'X)^{-1}X'$ has rank $n$, so $X(X'X)^{-1}X'=I_n. $

Thus $$ X(X'X)^{-1}X'-J/n=I_n-J/n $$ is a projection ($P$ is a projection if and only if $I-P$ is).


A second method would be to show directly that $X(X'X)^{-1}X'$ is the projection onto the span of the columns of $X$. Indeed, if $X=\begin{bmatrix} x_1&\cdots&x_p\end{bmatrix}$, then (with $c_j(A)$ denoting the $j^{\rm th}$ column of $A$) \begin{align} X(X'X)^{-1}X'x_j&=X(X'X)^{-1}c_j(X'X)=X\,c_j((X'X)^{-1}X'X))\\ \ \\ &=X\,c_j(I_p)=Xe_j=c_j(X)=x_j. \end{align}