0% found this document useful (0 votes)
72 views10 pages

EEP311L Chapter 17 The QR Method

The QR method can obtain all the eigenvalues of a square matrix. It uses the fact that any square matrix A has a QR decomposition into matrices Q and R, where Q is orthogonal. The QR method iterates by transforming the matrix into tridiagonal form H, performing QR decomposition on H, and multiplying Q and R in reverse order to form a new H. The diagonal of H will converge to the eigenvalues of A. The key steps are implemented in a MATLAB function that performs the QR decomposition and iterates until the eigenvalues converge.

Uploaded by

Yamburger Love
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views10 pages

EEP311L Chapter 17 The QR Method

The QR method can obtain all the eigenvalues of a square matrix. It uses the fact that any square matrix A has a QR decomposition into matrices Q and R, where Q is orthogonal. The QR method iterates by transforming the matrix into tridiagonal form H, performing QR decomposition on H, and multiplying Q and R in reverse order to form a new H. The diagonal of H will converge to the eigenvalues of A. The key steps are implemented in a MATLAB function that performs the QR decomposition and iterates until the eigenvalues converge.

Uploaded by

Yamburger Love
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

EEP311L

Numerical Methods
and Analysis LAB
Linear Algebra
CHAPTER 17: The QR Method*
The QR Method*
The Power Method and Inverse Power
Method each give us only one eigenvalue-
eigenvector pair. While both of these
methods can be modified to give more
eigenvalues and eigenvectors, there is a
better method for obtaining all the
eigenvalues called the QR method. This is
the basis of all modern eigenvalue
software, including Matlab.
The QR Method*
The QR method uses the fact that any
square matrix has a QR decomposition. That
is, for any A there are matrices Q and R
such the A = QR where Q has the property
Q −1 = Q ‘
and R is upper triangular. A matrix Q with the
property that its transpose equals its inverse is
called an orthogonal matrix, because its
column vectors are mutually orthogonal.
The QR Method*
The QR method consists of iterating
following steps:
Transform A into a tridiagonal matrix H.
Decompose H in QR.
Multiply Q and R together in reverse
order to form a new H.
The diagonal of H will converge to the
eigenvalues.
The QR Method*
The details of what makes this method converge are
beyond the scope of our discussion. However, we note
the following theory behind it for those with more
familiarity with linear algebra.
First the Hessian matrix H is obtained from A by a series of
similarity transformation, thus it has the same eigenvalues
as A.
Secondly, if we denote by H0, H1, H2, . . ., the sequence of
matrices produced by the iteration, then
Hi+1 = RiQi = Q −1 i QiRiQi = Q ‘ iHiQi .
Thus each Hi+1 is a related to Hi by an (orthogonal) similarity
transformation and so they have the same eigenvalues as
A.
The QR Method*
There is a built-in QR decomposition in
Matlab which is called with the
command: [Q R] = qr(A). Thus the
following program implements QR
method until it converges:
The QR Method*
function [E , steps ] = myqrmethod ( A )
% Computes all the eigenvalues of a matrix using the QR method .
% Input : A -- square matrix
% Outputs : E -- vector of eigenvalues
% steps -- the number of iterations it took
[ m n ] = size ( A );
if m ~= n
warning ( ’ The input matrix is not square . ’)
return
end
% Set up initial estimate
H = hess ( A );
E = diag ( H );
change = 1;
steps = 0;
% loop while estimate changes
The QR Method*
while change > 0
Eold = E ;
% apply QR method
[ Q R ] = qr( H );
H = R * Q ;
E = diag ( H );
% test change
change = norm ( E - Eold );
steps = steps +1;
end
end

As you can see the main steps of the program are very simple. The
really hard calculations are contained in the built-in commands
hess(A) and qr(H).
The QR Method*
Run this program and compare the results with Matlab’s
built in command:
>> format long
>> format compact
>> A = hilb (5)
>> [ Eqr , steps ] = myqrmethod ( A )
>> Eml = eig ( A )
>> diff = norm ( Eml - flipud ( Eqr ))

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy