[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Octave QR factorization
From: |
Bart Vandewoestyne |
Subject: |
Octave QR factorization |
Date: |
Wed, 17 Dec 2003 14:04:21 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 |
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 QR factorization,
Bart Vandewoestyne <=
Re: Octave QR factorization, A S Hodel, 2003/12/17