


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



CAAM 551 Problem set 2 Due Wed. 17 Sep. 08.
Note: If you are a CAAM major, you must do problem 3 instead of prob- lem 1. If you are not a CAAM major, you may do problem 1 or problem 3 (DO NOT DO BOTH).
Problem 1
% CSR Storage % % AA = [ 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. ] % JA = [ 1 4 1 2 4 1 3 4 5 3 4 5] % ^ ^ ^ ^ ^ % IA = [ 1 3 6 10 12 13]
function [x] = SLsolve(AA,JA,IA,b);
where the lower triangular matrix L is stored in the AA, JA, IA CSR data structure. (You can use L in place of A in the notation if you wish.) Write a test function to demonstrate your solver works correctly and test in on a random sparse lower triangular L (set the diagonals to 1 to assure non-singularity, but don’t assume this in the code).
Problem 2
Do problems 4 a,b,c,d and 12 on pages 98-100 of Saad. For problem 4, you can save some time by creating the matrices A and B in Matlab putting the numerical value 1 in place of *. Then you can do the matrix multiplications in Matlab. You may display the matlab results instead of writing them out by hand.
For problem 12, you may wish to use a consequence of the Cayley- Hamilton theorem which says that if a matix A is nonsingular (hence square) then A−^1 = γ 0 I + γ 1 A + γ 2 A^2 +... + γn− 1 An−^1 ,
where the γj are scalars. We shall prove this later in the course but you may assume it is true for this problem.
Problem 3
The following function will create a struct in which you can create the CSR storage scheme and then just refer to a single entity instead of having to pass three arrays.
function [s] = csr(nz,m,n); % % This sets up a struct s to hold a matrix A in CSR format %
s = struct(’nz’,nz,’m’,m,’n’,n,’ia’,[1:n+1],’ja’,[1:nz],’aa’,randn(nz,1));
Problem 4
Given an m × n matrix A with m > n and a positive number λ, a regularized least squares solution xλ may be computed by solving
min ‖
( A μI
) x −
( b 0
) ‖ 2 ,
where μ =
λ.
a. Derive the normal equations for the regularized least squares problem given above.
b. Show AT^ A + λI is symmetric and positive definite for every positive value of λ. Prove that the regularized least squares solution xλ is unique for every postive value of λ.
c. Use the Singular Value Decomposition of A to express the solution xλ to the problem min‖
( A μI
) x −
( b 0
) ‖ 2
where b ∈ Rm^ and μ^2 = λ.
d. Prove that limλ→ 0 + xλ = xLS the minimum norm least squares solu- tion (Regardless of the rank of A).