help-octave
[Top][All Lists]
Advanced

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

Re: Step-function fit using leasqr


From: Tweety
Subject: Re: Step-function fit using leasqr
Date: Fri, 2 Sep 2016 09:18:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0



Am 01.09.2016 um 22:03 schrieb Doug Stewart:


On Thu, Sep 1, 2016 at 3:21 PM, Tweety <address@hidden> wrote:
Dear all,

I am trying to fit measured data using a step function, please see the attachments. I get an error "weighted residuals are not real". Ok, additionally to a conceptual glitch I might have bad initial values but I thought Marquardt Levenberg was supposed to converge even in that case. What am I missing?

I appreciate any suggestions. I might be on the wrong track with the model function and the initial values, so if there are any better approaches please let me know.

Why do I want to fit this data? Firstly, I need some kind of look-up for various x-values which might not coincide with measured x-values. Secondly, I need to get rid of the scatter in the end of the measurement for further processing. Is there perhaps a simpler way to achieve this?

Code for reference w/o attachment:

E = dlmread('data.txt');
x = E(:,1);
y = E(:,2);
q = [1; .25; .25];
function res = f(x,q)
  res = q(1) - exp((q(2).*x).^q(3));
end
[fr,q,cvg,iter_r] = leasqr(x,y,q,'f',.0001,40);

Any help would be appreciated. Thanks and kind regards, Jan


_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave


The data file that you attached is faulty.
try plotting just the x values

plot(x)

--
DASCertificate for 206392

That is right, sorry. Please find attached the right files.
Thanks and kind regards,
Jan

Attachment: data.txt
Description: Text document

Attachment: datafit.m
Description: Text Data


reply via email to

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