Search⌘ K
AI Features

Inverse of a Rectangular Matrix

Explore the concept of matrix invertibility extended to rectangular matrices. Understand the criteria involving rank for the existence of left or right inverses, and learn how to compute these inverses using matrix multiplication and transposes. This lesson helps you apply these principles in data science tasks involving non-square matrices.

We’ve already discussed the inverse of a square matrix in detail and provided multiple examples. In this lesson, we’ll extend the discussion to rectangular matrices, which are matrices that have a different number of columns and rows.

Rank and invertibility

The rank of a matrix generally answers the question of invertibility. An m×nm \times n matrix AA is invertible if it has either a full column rank or a full row rank.

r(A)=min(m,n)r(A) = min(m,n)

Also, for any matrix, AA,

r(A)=r(ATA)=r(AAT)r(A)=r(A^TA)=r(AA^T)

Python 3.8
import numpy as np
from numpy.linalg import matrix_rank as r
order = np.random.randint(low=2, high=10, size=2)
m, n = order[0], order[1]
A = np.random.rand(m, n)
print(f'order(A)={A.shape}\nr(A)={r(A)}\nr(ATA)={r(A.T.dot(A))}\nr(AAT)={r(A.dot(A.T))}')

For square matrices, the number of rows, mm, is equal to the number of columns, nn. This allows square matrices to have a two-sided inversetwosided_Inverse. For rectangular matrices, the condition doesn’t hold. They either have a left inverse or a right inverse.

Left inverse

If a matrix, AA, has full column rank, r(A)=nr(A)=n, then it would have a left inverse, LL, such that:

A matrix with a full column rank could have multiple left inverses.

One possibility is:

...