Why is the sum of elements in each row of $X(X^T X)^{-1} X^T$ in OLS equal to $1$?

1.7k Views Asked by At

I have noticed that the sum of elements in each row (and each column, since the matrix is symmetric) of $X(X^T X)^{-1}X^T$, where $X$ is the information matrix in the OLS regression, is equal to 1. Is there a proof for this result, and what is the intuitive explanation?

1

There are 1 best solutions below

2
On BEST ANSWER

The column of $1$s in $X$ is the key. The matrix $P=X(X^TX)^{-1}X^T$ computes orthogonal projection onto the columns of $X$. This map is the identity on the column space of $X$, so in particular every column of $X$ is an eigenvector of $P$ with eigenvalue $1$. Right-multiplying a matrix by $\mathbb 1 = (1,\dots,1)^T$ sums its rows, and since we have $P\mathbb 1=\mathbb 1$ this means that all of the row sums are equal to $1$.