From help-octave-request at bevo dot che dot wisc dot edu Wed Dec 17 14:19:28 2003 Subject: Re: Octave QR factorization From: A S Hodel To: Bart Vandewoestyne Cc: help-octave at bevo dot che dot wisc dot edu Date: Wed, 17 Dec 2003 14:19:02 -0600 I am unable to access your script. You should check norm(Q*R - A)/norm(A), which will (typically) be around m*n*1e-15, where [m,n] = size(A). You cannot expect perfect equality in numerical calculations. Well, actually, you *can* expect it, but you'd be often disappointed by your results. On Wednesday, December 17, 2003, at 02:04 PM, Bart Vandewoestyne wrote: > Hello Octave-list, > > While I was checking the correctness of an exercise given to my > students during one of my algebra exercise sessions, i found the > following curiosity: > > The purpose of the exercise was for students to calculate the QR > factorization of a given matrix A. Now all I wanted to do is enter > the factorization we found by hand into Octave and see if the product > of Q and R is again the original matrix A. > > What I found is that when I multiply the matrices Q and R we've found > by hand and then check for Q*R==A, Octave tells me that Q*R is not > equal to A, most probably due to rounding errors I guess... > > If I run the same script in Matlab, Matlab *does* give me that > Q*R=A... so it doesn't experience the rounding errors as much as > Octave does??? > > So now my question is: why does Matlab gives different results than > Octave? Is there a big difference in the implementation of QR between > Matlab and Octave? Is there a way to decrease the rounding errors > made by Octave so we get the same accuracy as Matlab? > > The script I used can be found at > http://www.cs.kuleuven.ac.be/~bartv/p370_oef1_6_17.m > > When replying, please also reply to me personally, as I am not > subscribed to the list... > > Thanks, > Bart > > -- > Bart Vandewoestyne Bart.Vandewoestyne_at_pandora.be > Naamsesteenweg 328 bus 201 GSM: +32 (0)478 397 697 > B-3001 Heverlee http://osswin.sourceforge.net > ---------------------------------------------------------------------- > "Theory is the general; experiments are the soldiers." (Leonardo da > Vinci) > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > > ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------