help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: chol: matrix not positive definite


From: Geordie McBain
Subject: Re: chol: matrix not positive definite
Date: Tue, 17 Aug 2004 09:51:22 -0400

Hello,

  I think the assuredly positive Hermitian matrices should be formed
with X'*X rather than X.'*X

I don't understand the latter (dot prime star).  What does it do?

With A=rand(3)+1i*rand(3), A'*A is positive Hermitian but A.'*A isn't.

Geordie McBain


On Mon, 2004-08-16 at 10:50, Pascal A. Dupuis wrote:
> Hello,
> 
> I generate a spare matrix X the following way:
> 
> X=[ C0 0  0  0  0
>     C1 C0 0  0  0
>     C2 C1 C0 0  0
>     ...
>           C2 C1 C0]
> 
> with a size of N, N-2 (N >> 2), and C0+C1+C2=0; ||(C0,C1,C2)|| = 1.
> 
> then I compute:
> 
> xinv = inv(X.'*X);
> H = chol(xinv);
> 
> which results in:  chol: matrix not positive definite
> 
> But by construction the matrix should be positive definite, as
> range(X)=N-2. OTOH, X is also badly conditionned:
> 
> [dummy, rcond]=inv(X.'*X);
> rcond =  1.0498e-10
> 
> 
> If I check the eigenvalues of X.'*X, they are all  > 0, although some
> of them are very small. (~= 1e-10). So, is it a problem of numerical
> inaccuracy in the computation of chol ? Or should I instead compute 
> H = chol(pinv(X.'*X)) 
> 
> TIA
> 
> Pascal Dupuis



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]