Trace of $x(x^\top x)^{-1}x^\top$

94 Views Asked by At

Let $x_i^\top=(1,x_{1,i}\ldots,x_{d,i})\in\mathbb{R}^{1\times d+1}$ for $i\in\{1,\ldots, n\}$ linearly independent and $x\in\mathbb{R}^{n\times d+1}$, where the $i$-th row of $x$ equals $x_i^\top$. I want to find the trace of the matrix this matrix, i.e. $$\operatorname{tr}( x(x^\top x)^{-1} x^\top)$$ It is easy to show, that $$(x(x^\top x)^{-1} x^\top)^2=x(x^\top x)^{-1} x^\top$$ and $$(x(x^\top x)^{-1} x^\top)^\top=x(x^\top x)^{-1} x^\top$$ such that trace and rank are the same: $$\operatorname{tr}( x(x^\top x)^{-1} x^\top)=\operatorname{rk}( x(x^\top x)^{-1} x^\top)$$

However, I still struggle to find $\operatorname{rk}( x(x^\top x)^{-1} x^\top)$. My guess is that it is $d$ oder $d+1$, but I am not able to show this.

Any hint or help is appriciated!

Thank you in advance!

1

There are 1 best solutions below

3
On BEST ANSWER

Note that whenever the product $AB$ is defined, we have $\operatorname{tr}(AB) = \operatorname{tr}(BA)$. It follows that $$ \operatorname{tr}(x[(x^\top x)^{-1}x^\top]) = \operatorname{tr}([(x^\top x)^{-1}x^\top]x) = \operatorname{tr}((x^\top x)^{-1}(x^\top x)) = \operatorname{tr}(I) = d+1. $$