Repository navigation
Matrix Factorizations
Factoring is always fun and sometimes useful. We factor numbers and polynomials:
Turns out, we can sometimes factor matrices as well. There are many matrix factorizations serving various purposes. In 2000, the Institute of Electrical and Electronics Engineers (IEEE) made a list of the top 10 algorithms of the 20th century. One of the top 10 is the general idea of Matrix Factorization because of the many applications and advances due to these factorizations.
We will introduce three matrix factorizations today. The algorithm to compute each is different, but they are all built-in functions in Python, which is where we'll turn to actually use them.
Many square matrices can be factored into the product of a lower triangular matrix times an upper triangular matrix:
We can quickly solve this system in two steps:
- Solve
$\large L\vec{y}=\vec{b}$ for$\large \vec{y}$ . The lower triangular structure makes this quick and easy. - Solve
$\large U\vec{x}=\vec{y}$ for our solution$\large \vec{x}$ .
Here's an example. Let's solve
Using the factorization
The process is illustrated in the video:
To find the eigenvalues of an
So how does Python quickly give us the eigenvalues and eigenvectors for large matrices? Every square matrix
Note
The
What does this have to do with eigenvalues? With the
- Start with
$\large A_0=A$ . - In a loop, factor
$\large A_k=Q_kR_k$ . - Define our next
$\large A$ by reversing the order of multiplication:$\large A_{k+1}=R_kQ_k$ .
If we repeat this enough, the
Note
There is a mysterious "reverse the order to RQ" step in the middle of this process. This is actually something called a "similarity transformation" because
Below, we have a matrix
We can get as close to the actual eigenvalues as we like by iterating sufficiently far in this process!
On occasion, we want to compute
Our final factorization today allows us to write a matrix in terms of a diagonal matrix.
Definition: A square matrix
$\large A$ is diagonalizable if$\large A$ can be factored to$\large A=PDP^{-1}$ for a diagonal matrix$\large D$ and an invertible matrix$\large P$ .
Theorem: An
$\large n\times n$ matrix$\large A$ is diagonalizable if and only if$\large A$ has$\large n$ linearly independent eigenvectors. Then the columns of$\large P$ are the eigenvectors of$\large A$ , and the diagonal entries of$\large D$ are the corresponding eigenvalues.
As an example, find the diagonalization of
The solution is in the video:
Warning
The theorem says
Now, notice that if
In general, we have
We will see an example in the next lesson where raising
There are many other factorizations that are useful in various situations. We've highlighted three of them here as examples of the entire idea. As you can see, they are used for fairly different purposes.
I can:
- Solve a small system given its
$\large LU$ factorization. - Find the approximate eigenvalues of
$\large A$ from the output of a$\large QR$ algorithm. - Find the diagonalization of a square matrix
$\large A$ . - Raise
$\large A$ to a high power given the diagonalization of$\large A$ .