Re: Distribution fitting



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.
.



Relevant Pages

  • Re: Distribution fitting
    ... Peter Perkins wrote: ... > Jan Van den Bulcke wrote: ... >> like a distribution. ... > a Weibull distribution? ...
    (comp.soft-sys.matlab)
  • Re: Predicting using SAS-Survival analysis
    ... The problem with simply using the highest likelihood is that those ... one parameter, Weibull, logistic, log-normal, normal, and log-logistic ... are two-parameter distributions, and gamma has three. ... chi-square distribution with 1 degree of freedom, ...
    (sci.stat.math)
  • Re: Predicting using SAS-Survival analysis
    ... The problem with simply using the highest likelihood is that those ... one parameter, Weibull, logistic, log-normal, normal, and log-logistic ... are two-parameter distributions, and gamma has three. ... chi-square distribution with 1 degree of freedom, ...
    (sci.stat.edu)
  • Re: Computing derivative using finite differnce method
    ... Inorder to compute the asympotic covariance of the MLE of Weibull ... I took the data set: ... and the loglikehood function for the Weibull distribution fuction: ...
    (comp.soft-sys.matlab)
  • Computing derivative using finite differnce method
    ... Inorder to compute the asympotic covariance of the MLE of Weibull ... I took the data set: ... and the loglikehood function for the Weibull distribution fuction: ...
    (comp.soft-sys.matlab)