Question: needs to be done using octave/matlab 3.12. (a) Implement both the classical and mod- ified Gram-Schmidt procedures and use each to generate an orthogonal matrix


needs to be done using octave/matlab
3.12. (a) Implement both the classical and mod- ified Gram-Schmidt procedures and use each to generate an orthogonal matrix Q whose columns form an orthonormal basis for the column space of the Hilbert matrix H, with entries hy = 1/(i+j- 1), for n = 2,..., 12 (see Computer Problem 2.6). As a measure of the quality of the results (specifi- cally, the potential loss of orthogonality), plot the quantity - log10 (||1 - 2"), which can be in- terpreted as "digits of accuracy," for each method as a function of n. In addition, try applying the classical procedure twice (i.e., apply your classi- cal Gram-Schmidt routine to its own output Q to obtain a new Q), and again plot the resulting departure from orthogonality. How do the three methods compare in speed, storage, and accuracy? (6) Repeat the previous experiment, but this time use the Householder method, that is, use the ex- plicitly computed orthogonal matrix Q resulting from Householder QR factorization of the Hilbert matrix. Note that if the routine you use for House- holder QR factorization does not form explic- itly, then you can obtain Q by multiplying the sequence of Householder transformations times a matrix that is initialized to the identity matrix I (see previous exercise). Again, plot the departure from orthogonality for this method and compare it with that of the previous methods. (c) Repeat the previous experiment, but this time use the SVD to obtain the orthonormal basis (see Section 3.6.1). (d) Yet another way to compute an orthonormal basis is to use the normal equations. If we form the cross-product matrix and compute its Cholesky factorization APA = LL", then we have I = I'AAL-" (AL-')'(AL-"), which means that Q=AL-" is orthogonal, and its column space is obviously the same as that of A. Repeat the previous experiment using Hilbert matrices again, this time using the Q obtained in this way from the normal equations (the re- quired triangular solution may be a little tricky to compute, depending on the software you use). Again, plot the resulting departure from orthog- onality and compare it with that of the previous methods. (e) Can you explain the relative quality of the re- sults you obtained for the various methods used in these experiments? 3.12. (a) Implement both the classical and mod- ified Gram-Schmidt procedures and use each to generate an orthogonal matrix Q whose columns form an orthonormal basis for the column space of the Hilbert matrix H, with entries hy = 1/(i+j- 1), for n = 2,..., 12 (see Computer Problem 2.6). As a measure of the quality of the results (specifi- cally, the potential loss of orthogonality), plot the quantity - log10 (||1 - 2"), which can be in- terpreted as "digits of accuracy," for each method as a function of n. In addition, try applying the classical procedure twice (i.e., apply your classi- cal Gram-Schmidt routine to its own output Q to obtain a new Q), and again plot the resulting departure from orthogonality. How do the three methods compare in speed, storage, and accuracy? (6) Repeat the previous experiment, but this time use the Householder method, that is, use the ex- plicitly computed orthogonal matrix Q resulting from Householder QR factorization of the Hilbert matrix. Note that if the routine you use for House- holder QR factorization does not form explic- itly, then you can obtain Q by multiplying the sequence of Householder transformations times a matrix that is initialized to the identity matrix I (see previous exercise). Again, plot the departure from orthogonality for this method and compare it with that of the previous methods. (c) Repeat the previous experiment, but this time use the SVD to obtain the orthonormal basis (see Section 3.6.1). (d) Yet another way to compute an orthonormal basis is to use the normal equations. If we form the cross-product matrix and compute its Cholesky factorization APA = LL", then we have I = I'AAL-" (AL-')'(AL-"), which means that Q=AL-" is orthogonal, and its column space is obviously the same as that of A. Repeat the previous experiment using Hilbert matrices again, this time using the Q obtained in this way from the normal equations (the re- quired triangular solution may be a little tricky to compute, depending on the software you use). Again, plot the resulting departure from orthog- onality and compare it with that of the previous methods. (e) Can you explain the relative quality of the re- sults you obtained for the various methods used in these experiments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
