[SciPy-User] qr decompostion gives negative q, r ?

Jason Grout jason-sage@creativetrax....
Tue Nov 20 19:29:27 CST 2012


On 11/20/12 6:49 PM, Virgil Stokes wrote:

> Thanks for looking at this problem. I believe that this is a serious
> issue that does deserve some attention.

I'm curious: are you *guaranteed* by matlab (e.g., it's documented) to 
get a PD R matrix, or does it just happen in the cases you checked?  If 
you aren't guaranteed it, then it seems very shaky to depend on it even 
from matlab.  Of course, if it doesn't mention it in the docs, then who 
knows if it is guaranteed---matlab is closed source, so you can't just 
go check the code yourself.

The way I read the docs at http://www.mathworks.com/help/matlab/ref/qr.html:

"[Q,R] = qr(A), where A is m-by-n, produces an m-by-n upper triangular 
matrix R and an m-by-m unitary matrix Q so that A = Q*R."

it sounds like you shouldn't depend on R being PD even from matlab, even 
if it's worked out that way in a few of your cases.

Thanks,

Jason



More information about the SciPy-User mailing list