# Idempotent matrix

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

## Definition

A $n\times n$ square matrix $A$ is called idempotent if, multiplied by itself, yields itself, i.e.

$A{\text{ idempotent}}\quad \iff \quad A^{2}=A$ ## Example

Examples of $2\times 2$ idempotent matrices are:

${\begin{bmatrix}1&0\\0&1\end{bmatrix}}\qquad {\begin{bmatrix}3&-6\\1&-2\end{bmatrix}}$ Examples of $3\times 3$ idempotent matrices are:

${\begin{bmatrix}1&0&0\\0&0&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 ${\begin{pmatrix}a&b\\c&d\end{pmatrix}}$ is idempotent, then

• $a=a^{2}+bc,$ • $b=ab+bd,$ implying $b(1-a-d)=0$ so $b=0$ or $d=1-a,$ • $c=ca+cd,$ implying $c(1-a-d)=0$ so $c=0$ or $d=1-a,$ • $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. Notice that, for idempotent diagonal matrices, $a$ and $d$ must be either 1 or 0.

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

$a^{2}-a+b^{2}=0,$ or $\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 θ,

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

However, $b=c$ is not a necessary condition: any matrix

${\begin{pmatrix}a&b\\c&1-a\end{pmatrix}}$ with $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 $A^{2}=A$ , assuming that A has full rank (is non-singular), and pre-multiplying by $A^{-1}$ to obtain $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

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

A matrix A is idempotent if and only if for all positive integers n, $A^{n}=A$ . The 'if' direction trivially follows by taking $n=2$ . The 'only if' part can be shown using proof by induction. Clearly we have the result for $n=1$ , as $A^{1}=A$ . Suppose that $A^{k-1}=A$ . Then, $A^{k}=A^{k-1}A=AA=A$ , as required. Hence by the principle of induction, the result follows.

### Eigenvalues

An idempotent matrix is always diagonalizable and its eigenvalues are either 0 or 1.

### 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).

## 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 $(y-X\beta )^{\textsf {T}}(y-X\beta )$ where $y$ is a vector of dependent variable observations, and $X$ is a matrix each of whose columns is a column of observations on one of the independent variables. The resulting estimator is

${\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

${\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 $M$ and $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:

${\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 $M$ plays a role in other calculations as well, such as in determining the variance of the estimator ${\hat {\beta }}$ .

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