hw3p5sol

# hw3p5sol - loglog(lam,errs xlabel\lambda ylabel'error title...

This preview shows page 1. Sign up to view the full content.

Sheet1 Page 1 % % Math 5316 - Spring 2009 % Homework 4 - Problem 5 % Solution A=hilb(20) b=A*ones(20,1) M=A'*A z=A'*b lam=logspace(-15,0,100)' err=zeros(100,1) for k=1:100 x=(M+lam(k)*eye(20))\z errs(k)=norm(x-ones(20,1)) end Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 7.443639e-017. Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.026581e-016. Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.438156e-016. Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.011457e-016.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: loglog(lam,errs) xlabel('\lambda') ylabel('error') title(' Tikhonov regularization applied to the Hilbert matrix ') [emin kmin]=min(errs) emin emin = lam(kmin) ans = 1.52E-012 % We see the minimum error is .0023 - since the norm of % the ones vector is sqrt(60) the minimum relative error % is about 3X10^(-4) - Extremely good as the error without % regularization is more than 100% % % The best choice for lambda is about 1.5X10^(-12) % % We see that by using Tikhonov regularization we could % accurately find a nice'' solution to a highly ill-conditioned % problem....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online