The Jacobi method solves the eigenvalue problem of a real symmetric
matrice
, of which all eigenvalues are real and
all eigenvectors are orthogonal to each other (as shown
here). This algorithm
produces the eigenvalue matrix
and eigenvector matrix
satisfying
.
We first review the rotation of a vector in both 2 and 3-D space by
an orthogonal rotation matrix. In a 2-D space, the rotation matrix
is
![$\displaystyle {\bf R}(\theta)
=\left[\begin{array}{rr}\cos\theta&-\sin\theta\\ ...
...eta
\end{array}\right] =\left[\begin{array}{rr}c & -s\\ s & c\end{array}\right]$](img52.svg) |
(15) |
where
is the rotation angle,
and
.
This rotation matrix is orthogonal satisfying
.
Pre-multiplying
to a column vector
we
get a rotated version of the vector:
![$\displaystyle {\bf v}_2=\left[\begin{array}{c}x_2\\ y_2\end{array}\right]
={\bf...
...nd{array}\right]
=\left[\begin{array}{r}cx_1-sy_1\\ sx_1+cy_1\end{array}\right]$](img59.svg) |
(16) |
Taking transpose of the equatioin, we get the rotation of the row
vector
by post-multiplying
:
![$\displaystyle {\bf v}^T_2=[x_2,\,y_2]=({\bf Rv}_1^T={\bf v}^T_1{\bf R}^T
=[x_1\...
...\;\left[\begin{array}{rr}c&s\\ -s&c\end{array}\right]
=[cx_1-sy_1\;\;sx_1+cy_1]$](img62.svg) |
(17) |
As
is an orthogonal matrix, the norms of the column or row
vector is preserved, i..e.,
.
The rotation can be either clockwise if
or counter clockwise
if
.
In a 3-D space, a rotation by an angle
around each of the
three principal axes can be carried out by each of the following
three rotation matrices:
![$\displaystyle {\bf R}_x(\theta)
=\left[\begin{array}{rrr}1&0&0\\ 0&c&-s\\ 0&s&c...
... R}_z(\theta)
=\left[\begin{array}{rrr}c&-s&0\\ s&c&0\\ 0&0&1\end{array}\right]$](img66.svg) |
(18) |
In general, in an N-D space, the rotation around the direction
of the cross-product of the ith column and the jth column
(the normal direction of the plane spanned
by
and
), referred to as Givens rotation,
can be carried out by the following matrix:
This is an identical matrix with four of its elements modified,
and
. As all rows and columns are
orthonormal,
is orthogonal.
The Jacobi method finds the eigenvalues of a symmetric matrix
by
iteratively rotating its rows and columns in such a way that all of the
off-diagonal elements are eliminated one at a time, so that eventually the
resulting matrix becomes the diagonal eigenvalue matrix
,
and the product of all rotation matrices used in the process becomes the
orthogonal eigenvector matrix
. Specifically, in each iteration,
we pre and post multiply
to
, so that
its ith and jth columns and rows are modified, while all other elements
remain the same:
![$\displaystyle {\bf A}'={\bf R}{\bf A}{\bf R}^T
=\left[\begin{array}{ccccccc}
&\...
...ots&&\vdots&&\vdots\\
&\cdots&a'_{ni}&\cdots&a'_{nj}&\cdots&\end{array}\right]$](img77.svg) |
(20) |
As
is symmetric, the resulting matrix is also
symmetric:
![$\displaystyle {\bf A}'^T=({\bf R}{\bf A}{\bf R}^T)^T={\bf R}{\bf A}^T{\bf R}^T
={\bf R}{\bf A}{\bf R}^T={\bf A}'$](img78.svg) |
(21) |
For example, the 2nd and 4th columns and rows of a
matrix
are modified by
:
We can verify that as
is symmetric, i.e.,
, the resulting
is also symmetric. In
general, the ith and jth rows and columns are updated as shown
below:
As
is an orthogonal matrix that preserves the norms
of the row and column vectors of
, i.e.,
, when an off-diagonal
element
is eliminated to zero, the values of the
diagonal elements
and
will be increased. We desire
to find the rotation angle
so that after the rotation the
off-diagonal element becomes zero:
![$\displaystyle a'_{ij}=(c^2-s^2)a_{ij}+cs(a_{ii}-a_{jj})=0$](img104.svg) |
(24) |
This equation can be written as
i.e.,![$\displaystyle \;\;\;\;\;\;t^2+2wt-1=0$](img106.svg) |
(25) |
where we have defined
![$\displaystyle t=\tan\theta=\frac{\sin\theta}{\cos\theta}=\frac{s}{c},
\;\;\;\;\...
...;\;\;\;
w=\frac{c^2-s^2}{2cs}
=\frac{\cos(2\theta)}{\sin(2\theta)}=cot(2\theta)$](img107.svg) |
(26) |
Solving the equation above for
, we get
![$\displaystyle t_{1,2}=-w\pm\sqrt{w^2+1}$](img109.svg) |
(27) |
We will always choose the root with the smaller absolute value
for better precision:
![$\displaystyle t=\left\{\begin{array}{ll} -w+\sqrt{w^2+1}&\;\;\;\;\;\;\;\;w>0\\
-w-\sqrt{w^2+1}&\;\;\;\;\;\;\;\;w<0\end{array}\right.$](img110.svg) |
(28) |
Having found
, we can further find
and
in the rotation
matrix
:
![$\displaystyle s=\sin\theta=\frac{\tan\theta}{\sqrt{1+\tan^2\theta}}=\frac{t}{\s...
...;\;\;\;\;\;
c=\cos\theta=\frac{1}{\sqrt{1+\tan^2\theta}}=\frac{1}{\sqrt{1+t^2}}$](img112.svg) |
(29) |
by which
will be eliminated. This process is repeated
to eliminate the off-diagonal component with the maximum absolute
value, the pivot, until eventually the matrix becomes diagonal,
containing all eigenvalues.
Note that in each iteration only the ith and jth rows and columns
of the matrix are affected, we can therefore update these rows and
columns alone based on the equations given above, without actually
carry out the matrix multiplication to reduce computational cost.
Moreover, to minimize the roundoff error, we prefer to update the elements
of the rows and columns in an iterative fashion by adding a term to its old
value. To do so, we first solve the equation above
for
and
to get
Substituting these into the expressions for
and
respectively,
we get the following iterations:
![$\displaystyle a'_{jj}=s^2a_{ii}+2cs a_{ij}+c^2a_{jj}
=s^2\left(a_{jj}-\frac{c^2-s^2}{sc}a_{ij}\right)+2cs a_{ij}+c^2a_{jj}
=a_{jj}+t a_{ij}$](img117.svg) |
(30) |
and
![$\displaystyle a'_{ii}=c^2a_{ii}-2cs a_{ij}+s^2a_{jj}
=c^2a_{ii}-2cs a_{ij}+s^2\left(a_{ii}+\frac{c^2-s^2}{sc}a_{ij}\right)
=a_{ii}-t a_{ij}$](img118.svg) |
(31) |
We then rewrite the update equations for
and
as:
where
![$\displaystyle \tau=\frac{1-c}{s}=\frac{s}{1+c}=\frac{1-\cos\theta}{\sin\theta}
=\frac{\sin\theta}{1+\cos\theta}=\tan(\theta/2)$](img122.svg) |
(32) |
If we set an off-diagonal element to zero
by
,
with
and
defined above, then the values
of the diagonal elements
and
of the resulting matrix
will be increased. If we iteratively
carry out such rotations to set the off-diagonal elements to zero one at
a time
until eventually the resulting matrix
becomes diagonal
containing the eigenvalues of
, and
contains the corresponding eigenvectors.
In summary, here are the steps in each iteration of the Jacobi algorithm:
- Find the off-diagonal element
(
) of the greatest absolute
value, the pivot, and find
.
- Solve the quadratic equation
for
.
- Obtain
and
.
- Update all elements in the ith and jth rows and columns.
The iteration terminates when all off-diagonal elements are close enough to zero,
and we get a diagonal matrix as the eigenvalue matrix:
![$\displaystyle {\bf V}^T{\bf A}{\bf V}={\bf\Lambda}$](img136.svg) |
(34) |
where
is the eigenvector matrix.
Example: Find the eigenvalue matrix and eigenvector matrix of the
following matrix:
- Find
:
![$\displaystyle w=\frac{a_{22}-a_{11}}{2a_{12}}=\frac{1-3}{4}=-\frac{1}{2}$](img140.svg) |
(35) |
- Find
. As
, we have
![$\displaystyle t=\tan\theta=-(w+\sqrt{w^2+1})=\frac{1}{2}(1-\sqrt{5})=-0.618$](img142.svg) |
(36) |
The rotation angle is
.
- Find
and
![$\displaystyle c=\frac{1}{\sqrt{1+t^2}}=0.8507,\;\;\;\;\;\;s=\frac{t}{\sqrt{1+t^2}}=-0.5257$](img144.svg) |
(37) |
- Find
and
![$\displaystyle \lambda_1=a'_{11}=a_{11}-t a_{12}=4.2361,\;\;\;\;\;\;
\lambda_2=a'_{22}=a_{11}+t a_{12}=-0.2361$](img147.svg) |
(38) |
- Find the eigenvector and eigenvalue matrices: