Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am dealing with an example to show that the matrix($M = I − X(X'X)^{−1}X'$) is idempotent. X is a matrix with T rows and k columns and I the unit matrix of dimension T. And then to determine the rank of this matrix by using the properties of the trace of the matrix. 1. Idempotent means that matrix $A^2=A*A=A$

$$M = I − X(X'X)^{−1}X'$$ $$M = XX' − X(X'X)^{−1}X'$$ $$MM = (XX' − X(X'X)^{−1}X')(XX' − X(X'X)^{−1}X')$$ $$MM = (XX' − X(X'X)^{−1}X')(I − I)$$ -> MM is not idempotent

Is that correct?

2. $$Tr(AB)=Tr(BA)$$ $$Tr(M)=Tr(I − X(X'X)^{−1}X') = Tr(I − I) = Tr(0) = 0$$

Are my assumptions correct?


$$Tr(A-B)=Tr(A) - Tr(B)$$ $$Tr(M)=Tr(I) − Tr(X(X'X)^{−1}X')) = Tr(I) − Tr(I) = Tr(0) or Tr(I)= Rank(n)$$ Is this correct?

share|cite|improve this question
Why would $XX' = I$? That may not be true. – johnny Mar 12 '13 at 11:09
I am struggeling to find rules to determine the solution of the above example? Do you have a link or sth? – Le Chifre Mar 12 '13 at 11:18
up vote 3 down vote accepted
  1. You've wrongly assumed that $XX'=I$. To prove that $M$ is idempotent, note that $Y^2=(X(X'X)^{−1}X')^2=X\underbrace{(X'X)^{−1}X'X}_{=I}(X'X)^{−1}X'=:Y$, so $M^2=(I-Y)^2=I-2Y+Y^2=I-Y=M$.
  2. Indeed $\operatorname{tr}(X(X'X)^{−1}X')=\operatorname{tr}(X'X(X'X)^{−1})=\operatorname{tr}(I)$, but the size of this $I$ is $k\times k$, while the $I$ in $\operatorname{tr}(I-X(X'X)^{−1}X')$ has size $T\times T$. So, no, the trace of $M$ is not zero in general, but $\operatorname{tr}(I_T)-\operatorname{tr}(I_k)=T-k$. To find the rank of $M$ using the trace, observe that (a) every eigenvalue of $M$ is either $0$ or $1$ (why?) and (b) $M$ is unitarily diagonalizable (again, why?). So, the rank is equal to the trace. (Why~y~y~~???)
share|cite|improve this answer
For 1. Would you be so kind to provide me a hint, to get to a solution? – Le Chifre Mar 12 '13 at 11:19
THX!. ok to undestand it correctly, the right assumption is $XX=I$? btw why do you left the $I - ...$ out? – Le Chifre Mar 12 '13 at 11:26
@maximus I haven't made any additional assumptions. Why would you think that I have assumed $XX=I$? The key is, the $Y$ as defined in my answer is idempotent, so it follows that $M=I-Y$ is also idempotent. – user1551 Mar 12 '13 at 11:32
@maximus The previous line has shown that $Y^2=Y$. – user1551 Mar 12 '13 at 13:10
@maximus Done. See my new edit. – user1551 Mar 12 '13 at 20:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.