Geometrical interpretation of eigendecomposition
¶
In the previous post,
we showed how to express a symmetric matrix
as the product of three matrices,
a process known as eigendecomposition.
In this post, we revisit this procedure,
but from a geometrical perspective.
To begin, let’s assume that a symmetric matrix
has eigenvectors,
and each eigenvector is an column vector
then the transpose of is a row vector
and their multiplication
becomes an matrix.
Let’s return to .
First, we calculate to simplify the eigendecomposition equation:
Now the eigendecomposition becomes:
Therefore, the matrix can be broken into matrices
with the same shape (),
and each of these matrices has a multiplier
which is equal to the corresponding eigenvalue .
Each of the matrices
is called a projection matrix.
Imagine that we have a vector and a unit vector .
The inner product of and which is equal to
gives the scalar projection
of onto ,
which is the length of the vector projection of into .
If we multiply by again,
gives a vector which is called the orthogonal projection of onto .
This is shown in Figure 1.
Multiplying a vector with a projection matrix.
Therefore, when is a unit vector,
multiplying by
will give the orthogonal projection of onto ,
and that is why is called the projection matrix.
Multiplying by , we get the
orthogonal projection of onto .
Now let’s use R to calculate the projection matrices of matrix
mentioned before.
We had already calculated the eigenvalues and eigenvectors of .
The next chunk will apply eigendecomposition to
and print the first term, namely .
u_a <- eigen_a$vectors # an orthogonal matrix made of A's eigenvectorslambda_a <- eigen_a$values # a vector of A's eigenvaluesmat_a1 <- lambda_a[1] * u_a[,1] %*%t(u_a[,1])
mat_a1 |>round(3)
[,1] [,2]
[1,] 2.618 1.618
[2,] 1.618 1.000
As you can see, is also a symmetric matrix.
In fact,
it can be shown that
all projection matrices
in the eigendecomposition equation
are symmetric.
Other than being symmetric, projection matrices have some interesting properties.
Let’s continue with as an example.
We can calculate its eigenvalues and eigenvectors:
has two eigenvalues.
One is 0.
The other one is equal to of the orignal matrix .
In addition, its eigenvectors are identical to that of .
This is not a coincidence.
To see why, suppose we multiple by :
We know that is an eigenvector and it is normalized.
Therefore, its length is equal to 1,
so is its inner product with itself.
Thus we have:
Thus, is an eigenvector of ,
and the corresponding eigenvalue is .
Furthermore,
Because is symmetric,
its eigenvectors and are orthogonal,
or perpendicular.
Given that the inner product of two perpendicular vectors is zero,
the inner product of and is zero.
Thus we have
which means that is also an eigenvector of
and its corresponding eigenvalue is 0,
matching the output of eigen_a1$values[2] = 0.
In general,
eigendecomposition decomposes a symmetric matrix
into of projection matrices,
.
Each projection matrix is also symmetric,
which shares the same eigenvectors as the original matrix.
For a particular project matrix ,
the corresponding eigenvalue of eigenvector
is the -th eigenvalue of , ,
whereas all the remaining eigenvalues are zero.
Recall that a symmetric matrix scales a vector
along its eigenvectors,
proportionally to the corresponding eigenvalue.
Therefore, a projection matrix
stretches/shrinks a vector along by ,
but shrinks the vector to zero in all other directions.
Let’s illustrate this with
and one of its projection matrix in Figure 2.
Original vectors (left) and transformed vectors by a projection matrix (right).
All vectors in are transformed by ,
namely, stretched along and shrunk to zero along .
As a result, the initial circle became a straight line.
Previously, matrix transformed vectors in
into an ellipse, another 2-D shape.
And yet, matrix transformed vectors in
into a line, a 1-D shape.
Both and are symmetric.
How come one preserves whereas the other reduces the dimension?
In the next post,
we will discuss the reason by introducing the concept of rank.