在Matlab中将数据拟合到Gumbel和Weibull模型的其他公式

时间:2018-12-11 01:08:52

标签: matlab probability distribution weibull

我需要使极值分布适合风速数据。我正在使用Matlab来做到这一点。对于用户而言,可能看不到Gumbel和Weibull模型的替代公式,而不是Matlab在其命令中内置的公式:evfit和wblfit。因此,实现的定义是:

口香糖(适合最小值)

enter image description here

但是,我还需要另一个版本的Gumbel来拟合数据:

enter image description here

Weibull

Matlab中的Weibull模型也有相同的评论。在以前的版本中,Matlab在weibfit命令中实现了Weibull版本(现已不可用),后来被wblfit取代。

enter image description here

,以前是:

enter image description here

我的问题是:任何想法如何将数据拟合到Matlab中Gumbel和Weibull模型的先前定义?

谢谢

1 个答案:

答案 0 :(得分:2)

您可以使用函数mle估算自定义分布的参数:

自定义weibul PDF的示例:

data      = wblrnd(1,1,1000,1); %random weibull data
custompdf = @(x,a,b) (b*a).*x.^(b-1).*exp(-a*x.^b);                               %your custom PDF function
opt       = statset('MaxIter',1e5,'MaxFunEvals',1e5,'FunValCheck','off');         %Iteration's option
[param,ci]= mle(data,'pdf',custompdf,'start',[1 1],'Options',opt,'LowerBound',[0 0],'UpperBound',[Inf Inf])

如果函数无法收敛,则可以将起点调整为更合适的值。