help-octave
[Top][All Lists]
Advanced

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

rcond = 0 when using leasqr. How to check result?


From: oxyopes
Subject: rcond = 0 when using leasqr. How to check result?
Date: Tue, 21 Aug 2007 18:32:23 +0200

Dear octave friends,
both optimizations bellow agree in their results, but the latter gives a msg:
`` warning: inverse: matrix singular to machine precision, rcond = 0 ''

==== 1st =====
pin=[1 0.1];
F=@(x,p) p(1)*exp(-p(2)*x.^2);
leasqr(data(:,1),   data(:,2), pin, F );

==== 2nd =====
pin=[1  0.1  1];
F=@(x,p) p(1)*exp(-p(2)*x.^2) + 0*p(3)*x;
leasqr(data(:,1),   data(:,2), pin, F );

As you see, the term p(3) in the second is not used. I eventually activate it
in a script to account for offset or drift of the data. But to have this option
I get the warning message above. As i told, the result for p(1) and p(2)
is the same in both cases above, but how to be sure of that?
How to make sure that the result is not being modified by this warned event?
Or even more fancy, how to test that in the script and disable the warning?

I appended some sample data for testing. Thank you a lot for this and all
previous help from this comunity :-)

data=[
    1.000000    1.000000
    2.000000    0.892917
    3.000000    0.843611
    4.000000    0.762500
    5.000000    0.646528
    6.000000    0.527222
    7.000000    0.456944
    8.000000    0.338194
    9.000000    0.262639
   10.000000    0.208056
   11.000000    0.183889
   12.000000    0.116250
   13.000000    0.115694
   14.000000    0.111667
   15.000000    0.089583
   16.000000    0.105556
   17.000000    0.092222
   18.000000    0.095833
];


reply via email to

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