Re: Distribution fitting
- From: "Jan Van den Bulcke" <janvdbulck@xxxxxxxxxxx>
- Date: Wed, 5 Oct 2005 12:05:01 -0400
Jan Van den Bulcke wrote:
>
>
> Peter Perkins wrote:
>>
>>
>> Jan Van den Bulcke wrote:
>>
>>
>>> Well yes, but I just have one row of data that, once
plotted,
>> look
>>> like a distribution. I have found the help file 'Fitting
> custom
>>> univariate Distributions'. Maybe I also should have a look
at
>> this
>>> (at this moment I didn't find the demo you describe but I
>> continue
>>> looking but I think I have not the latest release (mine is
> R14))?
>>
>> The latest release is R14sp3.
>>
>> So you do not mean that if you make a histogram of your n
values,
>> it looks like
>> a Weibull distribution? Is what you mean that you have a
vector
> of
>> values
>> which, if you plotted them against 1:n, look like a Weibull (or
>> whatever) curve?
>> It sounds like you want NLINFIT or LSQCURVEFIT.
>>
>> - Peter
>>
>
> Exactly. I will try the two options you mentioned. I'll let you
> know
> when I succeed.
>
> Thanks,
>
> Jan.
Hello again,
I tried to fit a Weibull function (3 parameters) using nlinfit and I
have some problems/questions.
The data I am using:
x=1:1:43;
y= 43 numbers with values ranging from 20 to 90
plot(x,y) looks like a Weibull or some other distribution
The function I created (separate m-file):
function fitten=wbl(beta0,x)
fitten=(beta0(2)/beta0(3)).*(((x-beta0(1))./beta0(3)).^(beta0(2)-1)).*
exp(-((x-beta0(1))./beta0(3)).^beta0(2));
and in the main program:
options = optimset('MaxIter',1000, 'MaxFunEvals',1000);
beta0=[1 1 1];
[beta,r,J] = nlinfit(x',y,@wbl,beta0, options);
Using these data, I receive the following error:
??? Error using ==> nlinfit>checkFunVals
MODELFUN has returned Inf or NaN values.
Error in ==> nlinfit at 180
if funValCheck && ~isfinite(sse), checkFunVals(r); end
And when I change some of the initial parameters or rescale the y
value between 0 and 1, I get some results, some of them complex. And
in other cases the Jacobian is ill-conditioned.
Any solutions for this problem or does it heavily rely on the initial
parameter estimation and proposed function?
Thanks in advance,
Jan.
.
- References:
- Distribution fitting
- From: Jan Van den Bulcke
- Re: Distribution fitting
- From: Jan Van den Bulcke
- Re: Distribution fitting
- From: Peter Perkins
- Re: Distribution fitting
- From: Jan Van den Bulcke
- Distribution fitting
- Prev by Date: Re: Help: how to let 'textread' know it's a blank line?
- Next by Date: specgram and frequency
- Previous by thread: Re: Distribution fitting
- Next by thread: Re: Distribution fitting
- Index(es):
Relevant Pages
|