# Idempotent matrix

In linear algebra, an idempotent matrix is a matrix which, when multiplied by itself, yields itself.[1][2] That is, the matrix ${\displaystyle A}$ is idempotent if and only if ${\displaystyle A^{2}=A}$. For this product ${\displaystyle A^{2}}$ to be defined, ${\displaystyle A}$ must necessarily be a square matrix. Viewed this way, idempotent matrices are idempotent elements of matrix rings.

## Example

Examples of ${\displaystyle 2\times 2}$  idempotent matrices are:

${\displaystyle {\begin{bmatrix}1&0\\0&1\end{bmatrix}}\qquad {\begin{bmatrix}3&-6\\1&-2\end{bmatrix}}}$

Examples of ${\displaystyle 3\times 3}$  idempotent matrices are:

${\displaystyle {\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}}\qquad {\begin{bmatrix}2&-2&-4\\-1&3&4\\1&-2&-3\end{bmatrix}}}$

## Real 2 × 2 case

If a matrix ${\displaystyle {\begin{pmatrix}a&b\\c&d\end{pmatrix}}}$  is idempotent, then

• ${\displaystyle a=a^{2}+bc,}$
• ${\displaystyle b=ab+bd,}$  implying ${\displaystyle b(1-a-d)=0}$  so ${\displaystyle b=0}$  or ${\displaystyle d=1-a,}$
• ${\displaystyle c=ca+cd,}$  implying ${\displaystyle c(1-a-d)=0}$  so ${\displaystyle c=0}$  or ${\displaystyle d=1-a,}$
• ${\displaystyle d=bc+d^{2}.}$

Thus a necessary condition for a 2 × 2 matrix to be idempotent is that either it is diagonal or its trace equals 1. For idempotent diagonal matrices, ${\displaystyle a}$  and ${\displaystyle d}$  must be either 1 or 0.

If ${\displaystyle b=c}$ , the matrix ${\displaystyle {\begin{pmatrix}a&b\\b&1-a\end{pmatrix}}}$  will be idempotent provided ${\displaystyle a^{2}+b^{2}=a,}$  so a satisfies the quadratic equation

${\displaystyle a^{2}-a+b^{2}=0,}$  or ${\displaystyle \left(a-{\frac {1}{2}}\right)^{2}+b^{2}={\frac {1}{4}}}$

which is a circle with center (1/2, 0) and radius 1/2. In terms of an angle θ,

${\displaystyle A={\frac {1}{2}}{\begin{pmatrix}1-\cos \theta &\sin \theta \\\sin \theta &1+\cos \theta \end{pmatrix}}}$  is idempotent.

However, ${\displaystyle b=c}$  is not a necessary condition: any matrix

${\displaystyle {\begin{pmatrix}a&b\\c&1-a\end{pmatrix}}}$  with ${\displaystyle a^{2}+bc=a}$  is idempotent.

## Properties

### Singularity and regularity

The only non-singular idempotent matrix is the identity matrix; that is, if a non-identity matrix is idempotent, its number of independent rows (and columns) is less than its number of rows (and columns).

This can be seen from writing ${\displaystyle A^{2}=A}$ , assuming that A has full rank (is non-singular), and pre-multiplying by ${\displaystyle A^{-1}}$  to obtain ${\displaystyle A=IA=A^{-1}A^{2}=A^{-1}A=I}$ .

When an idempotent matrix is subtracted from the identity matrix, the result is also idempotent. This holds since

${\displaystyle (I-A)(I-A)=I-A-A+A^{2}=I-A-A+A=I-A.}$

If a matrix A is idempotent then for all positive integers n, ${\displaystyle A^{n}=A}$ . This can be shown using proof by induction. Clearly we have the result for ${\displaystyle n=1}$ , as ${\displaystyle A^{1}=A}$ . Suppose that ${\displaystyle A^{k-1}=A}$ . Then, ${\displaystyle A^{k}=A^{k-1}A=AA=A}$ , since A is idempotent. Hence by the principle of induction, the result follows.

### Eigenvalues

An idempotent matrix is always diagonalizable.[3] Its eigenvalues are either 0 or 1: if ${\displaystyle \mathbf {x} }$  is a non-zero eigenvector of some idempotent matrix ${\displaystyle A}$  and ${\displaystyle \lambda }$  its associated eigenvalue, then ${\textstyle \lambda \mathbf {x} =A\mathbf {x} =A^{2}\mathbf {x} =A\lambda \mathbf {x} =\lambda A\mathbf {x} =\lambda ^{2}\mathbf {x} ,}$  which implies ${\displaystyle \lambda \in \{0,1\}.}$  This further implies that the determinant of an idempotent matrix is always 0 or 1. As stated above, if the determinant is equal to one, the matrix is invertible and is therefore the identity matrix.

### Trace

The trace of an idempotent matrix — the sum of the elements on its main diagonal — equals the rank of the matrix and thus is always an integer. This provides an easy way of computing the rank, or alternatively an easy way of determining the trace of a matrix whose elements are not specifically known (which is helpful in statistics, for example, in establishing the degree of bias in using a sample variance as an estimate of a population variance).

### Relationships between idempotent matrices

In regression analysis, the matrix ${\displaystyle M=I-X(X'X)^{-1}X'}$  is known to produce the residuals ${\displaystyle e}$  from the regression of the vector of dependent variables ${\displaystyle y}$  on the matrix of covariates ${\displaystyle X}$ . (See the section on Applications.) Now, let ${\displaystyle X_{1}}$  be a matrix formed from a subset of the columns of ${\displaystyle X}$ , and let ${\displaystyle M_{1}=I-X_{1}(X_{1}'X_{1})^{-1}X_{1}'}$ . It is easy to show that both ${\displaystyle M}$  and ${\displaystyle M_{1}}$  are idempotent, but a somewhat surprising fact is that ${\displaystyle MM_{1}=M}$ . This is because ${\displaystyle MX_{1}=0}$ , or in other words, the residuals from the regression of the columns of ${\displaystyle X_{1}}$  on ${\displaystyle X}$  are 0 since ${\displaystyle X_{1}}$  can be perfectly interpolated as it is a subset of ${\displaystyle X}$  (by direct substitution it is also straightforward to show that ${\displaystyle MX=0}$ ). This leads to two other important results: one is that ${\displaystyle (M_{1}-M)}$  is symmetric and idempotent, and the other is that ${\displaystyle (M_{1}-M)M=0}$ , i.e., ${\displaystyle (M_{1}-M)}$  is orthogonal to ${\displaystyle M}$ . These results play a key role, for example, in the derivation of the F test.

Any similar matrices of an idempotent matrix are also idempotent. Idempotency is conserved under a change of basis. This can be shown through multiplication of the transformed matrix ${\displaystyle SAS^{-1}}$  with ${\displaystyle A}$  being idempotent: ${\displaystyle (SAS^{-1})^{2}=(SAS^{-1})(SAS^{-1})=SA(S^{-1}S)AS^{-1}=SA^{2}S^{-1}=SAS^{-1}}$ .

## Applications

Idempotent matrices arise frequently in regression analysis and econometrics. For example, in ordinary least squares, the regression problem is to choose a vector β of coefficient estimates so as to minimize the sum of squared residuals (mispredictions) ei: in matrix form,

Minimize ${\displaystyle (y-X\beta )^{\textsf {T}}(y-X\beta )}$

where ${\displaystyle y}$  is a vector of dependent variable observations, and ${\displaystyle X}$  is a matrix each of whose columns is a column of observations on one of the independent variables. The resulting estimator is

${\displaystyle {\hat {\beta }}=\left(X^{\textsf {T}}X\right)^{-1}X^{\textsf {T}}y}$

where superscript T indicates a transpose, and the vector of residuals is[2]

${\displaystyle {\hat {e}}=y-X{\hat {\beta }}=y-X\left(X^{\textsf {T}}X\right)^{-1}X^{\textsf {T}}y=\left[I-X\left(X^{\textsf {T}}X\right)^{-1}X^{\textsf {T}}\right]y=My.}$

Here both ${\displaystyle M}$  and ${\displaystyle X\left(X^{\textsf {T}}X\right)^{-1}X^{\textsf {T}}}$ (the latter being known as the hat matrix) are idempotent and symmetric matrices, a fact which allows simplification when the sum of squared residuals is computed:

${\displaystyle {\hat {e}}^{\textsf {T}}{\hat {e}}=(My)^{\textsf {T}}(My)=y^{\textsf {T}}M^{\textsf {T}}My=y^{\textsf {T}}MMy=y^{\textsf {T}}My.}$

The idempotency of ${\displaystyle M}$  plays a role in other calculations as well, such as in determining the variance of the estimator ${\displaystyle {\hat {\beta }}}$ .

An idempotent linear operator ${\displaystyle P}$  is a projection operator on the range space ${\displaystyle R(P)}$  along its null space ${\displaystyle N(P)}$ . ${\displaystyle P}$  is an orthogonal projection operator if and only if it is idempotent and symmetric.

## References

1. ^ Chiang, Alpha C. (1984). Fundamental Methods of Mathematical Economics (3rd ed.). New York: McGraw–Hill. p. 80. ISBN 0070108137.
2. ^ a b Greene, William H. (2003). Econometric Analysis (5th ed.). Upper Saddle River, NJ: Prentice–Hall. pp. 808–809. ISBN 0130661899.
3. ^ Horn, Roger A.; Johnson, Charles R. (1990). Matrix analysis. Cambridge University Press. p. p. 148. ISBN 0521386322.