help-octave
[Top][All Lists]
Advanced

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

leasqr problem - covp is 'NA'!!!


From: neo7891
Subject: leasqr problem - covp is 'NA'!!!
Date: Fri, 15 Apr 2011 09:09:50 -0700 (PDT)

hey guys,

I'm try to solve exponential fitting with leasqr.
The fitting itself is really good - and I want to measure the estimation
error of parameters.
I found I can get the errors by :
========================================
sqrt(diag(covp))
========================================

but the problem is... my 'covp' is only...
========================================
covp =

    NA    NA    NA    NA
    NA    NA    NA    NA
    NA    NA    NA    NA
    NA    NA    NA    NA
========================================

here is the source... I hope I can get help from you!!!! Thanks a
lot!!!!!!!!

========================================
data = load("data2.txt");

x = data(1:length(data),1);
y = data(1:length(data),2);

orgFx = @(x, p) p(1) + p(2) * ( 1 - exp( -p(3) * ( x - p(4))));

pin = ones(1,4);
pin(1) = median(y(1:5));
pin(2) = max(y) - min(y);
pin(3) = abs(log(max(y) - min(y))) / (max(x)-min(x));
pin(4) = min(x);

F = orgFx;

[f,p,kvg,iter,corp,covp,covr,stdresid,Z,r2] = leasqr(x,y,pin,F);

plot(x, y, "r+", x, f, "b-");

fprintf("%f     %f     %f     %f\n", p(1), p(2), p(3), p(4));
========================================



--
View this message in context: 
http://octave.1599824.n4.nabble.com/leasqr-problem-covp-is-NA-tp3452439p3452439.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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