11.07.2015 Views

The Gram-Schmidt Procedure and Orthogonal Projections 1 ...

The Gram-Schmidt Procedure and Orthogonal Projections 1 ...

The Gram-Schmidt Procedure and Orthogonal Projections 1 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Unfortunately, the naive <strong>Gram</strong>-<strong>Schmidt</strong> procedure is numerically unstable, which meansthat it is highly sensitive to numerical errors. For example, try running NAIVEGS on the7th order Hilbert matrix:H7 = [ 1/1 1/2 1/3 1/4 1/5 1/6 1/7;1/2 1/3 1/4 1/5 1/6 1/7 1/8;1/3 1/4 1/5 1/6 1/7 1/8 1/9;1/4 1/5 1/6 1/7 1/8 1/9 1/10;1/5 1/6 1/7 1/8 1/9 1/10 1/11;1/6 1/7 1/8 1/9 1/10 1/11 1/12;1/7 1/8 1/9 1/10 1/11 1/12 1/13 ];C = NAIVEGS(H7);Z = abs(C * C’ - eye(7))In this computation, eye(7) denotes the 7 × 7 identity matrix, <strong>and</strong> abs computes theabsolute value of each matrix component.Ideally, what should Z be?What is the actual largest entry in Z?Fortunately, the <strong>Gram</strong>-<strong>Schmidt</strong> procedure can be made numerically stable via a simplemodification. Instead of computing∑i−1u i = v i − proj wk(v i )as in the naive <strong>Gram</strong>-<strong>Schmidt</strong> algorithm, compute u i in a series of steps:k=1u (1)i = v i − proj w1(v i )u (2)i = u (1)i − proj w2(u (1)i )u (3)i = u (2)i − proj w3(u (2)i ). .u i = u (i−2)i − proj wi−1(u (i−2)i )Copy your file NAIVEGS.m to the file GS.m <strong>and</strong> modify GS.m to implement the modified<strong>Gram</strong>-<strong>Schmidt</strong> procedure as the functionfunction w = GS(v)4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!