필터 지우기
필터 지우기

fitting a 3-parameter of Weibull PDF using mle

조회 수: 8 (최근 30일)
Vincent Moron
Vincent Moron 2018년 6월 8일
답변: Jeff Miller 2018년 6월 9일
Hello
I am trying to estimate the 3 parameters of a Weibull PDF on a series of positive values (n=934). My custom pdf is
custpdf=@(data,a,b,c) (a/b).*(((data-c)./b).^(a-1)).*(exp((-(data-c)./b).^(a)));
phat=mle(data,'pdf',custpdf,'start',[1 1 1]);
Error using mlecustom>llf_pdfcdf (line 440) The PDF function returned negative or zero values.
Error in fminsearch (line 200) fv(:,1) = funfcn(x,varargin{:});
Error in mlecustom (line 184) fminsearch(llf,start,opts,uncensData,censData,uncensFreq,censFreq,fun1Args,fun2Args,checkFunVals,lb,ub);
Error in mle (line 245) phat = mlecustom(data,varargin{:});
I tested also
phat=mle(data,'wblpdf',custpdf,'start',[1 1 1]);
But I get only two parameters
Vincent
Any idea about what is wrong ?

채택된 답변

Torsten
Torsten 2018년 6월 8일
custpdf = @(data,a,b,c) (data>c).*(b/a).*(((data-c)/a).^(b-1)).*exp(-((data-c)/a).^b);
opt = statset('MaxIter',1e5,'MaxFunEvals',1e5,'FunValCheck','off');
phat = mle(data,'pdf',custpdf,'start',[5 5 5],'Options',opt,...
'LowerBound',[0 0 -Inf],'UpperBound',[Inf Inf min(data)])
Best wishes
Torsten.
  댓글 수: 1
Vincent Moron
Vincent Moron 2018년 6월 8일
Thanks for the quick reply. The solution does not converge. I tried to increase the MaxIter but it still does not converge. So perhaps my data does not fit with a 3-parameter Wdl CDF ? I attached the data I am trying to fit

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Jeff Miller
Jeff Miller 2018년 6월 9일
Cupid ( GitHub ) says the ML estimates are Weibull(468169.4353,0.92433,11159.7031), obtained with:
mydist = Weibull(400000,.9,min(data));
mydist.EstML(data);
There don't seem to be numerical problems even though the numbers are so big. The following:
dataover1000 = data / 1000;
mydist2 = Weibull(400,.9,min(dataover1000));
mydist2.EstML(dataover1000)
gives the corresponding Weibull(468.1694,0.92433,11.1597).
Note that the estimate of the 3rd parameter is always the minimum of the data.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by