QR factorization

Bateman David-ADB014 David.Bateman at motorola.com
Fri Mar 28 17:23:18 CDT 2008


Observing Marco's posts from the past, I think he understands that there is no unique solution. I think the question was rather given that Octave and Matlab both claim to use the same LAPACK routines they come up with different (though equally valid) solutions. Matlab uses the Intel Blas/Lapack libraries and Octave is probably using Atlas so  the difference is probably in the details of the implementations of these libraries.

D.



-----Original Message-----
From: Moritz Borgmann [mailto:octave at moriborg.de]
Sent: Fri 28-Mar-08 9:04 PM
To: help-octave at octave.org
Cc: Marco Caliari
Subject: Re: QR factorization
 
>Hi all.
>
>If you try the following with Octave 3.0.0+
>
>octave:1> A=ones(3,4);
>octave:2> [Q,R]=qr(A);
>
>you get
>
>octave:3> Q
>Q =
>
>    -0.57735   0.81650   0.00000
>    -0.57735  -0.40825  -0.70711
>    -0.57735  -0.40825   0.70711
>
>With the other program, you get
>
>Q =
>
>     -0.5774   -0.5774   -0.5774
>     -0.5774    0.7887   -0.2113
>     -0.5774   -0.2113    0.7887
>
>and the same R. Both the factorizations satisfy Q*R=A and Q'*Q=eye(3) and
>both the programs claim to use the LAPACK routines DGEQRF and DORGQR.
>Where could be the difference?

look at the R matrix. Because A is rank-1, R has only one nonzero row 
(the first). Thus, the second and third columns of Q can be chosen 
arbitrarily as long as the columns of Q are orthonormal. There is 
simply no unique solution.

-M
_______________________________________________
Help-octave mailing list
Help-octave at octave.org
https://www.cae.wisc.edu/mailman/listinfo/help-octave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.cae.wisc.edu/pipermail/help-octave/attachments/20080328/8fee8380/attachment.html 


More information about the Help-octave mailing list