[SciPy-User] qr decompostion gives negative q, r ?
Wed Nov 21 01:42:31 CST 2012
On 21-Nov-2012 02:29, Jason Grout wrote:
> 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.
Of course you are correct Jason, and I have not checked every QR decomposition
in MATLAB and numpy. However, for my particular application I do know that the R
returned from MATLAB always has diagonal elements > 0, while this is not the
case for my installation of numpy.
> SciPy-User mailing list
More information about the SciPy-User