The power method is an iterative technique used in numerical analysis to find the dominant eigenvalue and corresponding eigenvector of a matrix. It is particularly useful for large sparse matrices where other methods may be computationally expensive. Its extension to the inverse power method is practical for finding any eigenvalue provided that a good initial approximation is known.
Ensure you have Python installed on your system. Then, install the necessary dependencies by running:
pip install -r requirements.txt
Let
We assume here there is a single eigenvalue of largest magnitude (the ‘dominant’ eigenvalue). Label them as follows:
Note that if
The simplest approach to computing
Now suppose that
and, applying
Since the
we expect the
Each iteration grows the largest term relative to the others, so after enough iterations only the first term (what we want) will be left.
Let’s formalize the observation and derive a practical method. The main trouble is that
Let
Poof. Since the eigenvectors form a basis, there are scalars
By assumption,
All the terms in the parentheses except the first go to zero in magnitude as
where
Thus, the power method computes the dominant eigenvalue (largest in magnitude), and the convergence is linear. The rate depends on the size of
The Inverse Power method is a modification of the Power method that gives faster convergence. It is used to determine the eigenvalue of
Suppose that matrix
Applying the Power Method to
where at each step,
and
The vector numpy.linalg.solve
function, that uses LU decomposition with partial pivoting and row interchanges.
As a practical example, we have implemented a Streamlit app that words on these methods. So have fun with it!
streamlit run app.py