hw1p3sol - We sse that the factorization errors are all...

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

View Full Document Right Arrow Icon
% Solution of HW1 Problem 3 % % We examine the accuracy of the Cholesky factorization and the solutions it produces % Cholerr=zeros(200,1); Solerr=zeros(200,1); for k=1:200 S=randn(100,100); A=S'*S; R=chol(A); x=randn(100,1); b=A*x; y=R\(R'\b); Cholerr(k)=norm(R'*R-A)/norm(A); Solerr(k)=norm(x-y)/norm(x); end figure hist(Cholerr) title(' Relative Errors in the Cholesky Factorization ') figure hist(Solerr) % To see a more interesting distribution lets take the log of the solution errors hist(log(Solerr)) hist(log10(Solerr)) title(' Relative Errors in the Solutions ')
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % % We sse that the factorization errors are all near machine epsilon - clustered % between 1 and 2 times 10^(-16). The solution errors are significantly larger % They are clustered around 10^(-12) with at least one larger than 10^(-9). % This can be explained by the fact that the Cholesky factorization algorithm % is always stable, but positive definite symmetric systems themselves can be % sensitive (ill-conditioned) % % The graphs are found in Cholerr.pdf and Solerr.pdf...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online