help-octave
[Top][All Lists]
Advanced

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

Re: octave can not solve x=A\B, but freemat can


From: CdeMills
Subject: Re: octave can not solve x=A\B, but freemat can
Date: Wed, 2 Apr 2014 00:08:20 -0700 (PDT)

tomdylan wrote
> Apparently freemat investigates the structure of A and chooses the "right"
> solver for the specific matrix. Octave instead gives me warnings:
> 
> "octave warning: inverse: matrix singular to machine precision, rcond = 0"

Hello Tom,

can you do

[U, S, V] = svd(A, 0);

then semilogy(diag(S)/S(1,1))

If the last values are small (let's say, < 1e-8), your matrix is
ill-conditionned and its inverse will be very sensitive to noise. 

You can study the sensitivity  of your solution to the smallest singular
values :

for indi=1:8
Ai = pinv(A, 10^-indi);
X(:, indi) = Ai*B;
end

I know this is not the right way to solve linear equations system; but look
at the evolution of the columns of X. If they converge to some solution
while not using the complete inverse, then there are probably issues with
your model structure. Maybe that scaling can help.

Regards

Pascal



--
View this message in context: 
http://octave.1599824.n4.nabble.com/octave-can-not-solve-x-A-B-but-freemat-can-tp4663428p4663437.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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