Reputation: 1511
I need to fit Extreme Value distributions to wind speed data. I'm using Matlab for doing this. It may not be evident to a user that there are alternative formulations of the Gumbel and Weibull models than those that Matlab has built in in its commands: evfit and wblfit. Thus, the definitions implemented are:
Gumbel (suited for minima)
However, there's another version of the Gumbel to which I need to fit the data:
Weibull
Same comments applies to the Weibull models in Matlab. In previous versions, Matlab implemented a version of the Weibull in the command weibfit (not available anymore), which was later replaced by wblfit.
and previously as:
My question is: any ideas how can the data be fitted to the previous definitions of the Gumbel and Weibull models in Matlab?
Thanks,
Upvotes: 1
Views: 344
Reputation: 10792
You can estimate the parameter of a custom distribution using the function mle
:
Example with your custom 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])
If the function doesn't converge, you can adjust the starting point with some better suited value.
Upvotes: 2