1

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)

enter image description here

However, there's another version of the Gumbel to which I need to fit the data:

enter image description here

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.

enter image description here

and previously as:

enter image description here

My question is: any ideas how can the data be fitted to the previous definitions of the Gumbel and Weibull models in Matlab?

Thanks,

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41
Oliver Amundsen
  • 1,491
  • 2
  • 21
  • 40
  • Have you considered something simple like minimizing the squared (or absolute) difference between your empirical [CDF](https://en.wikipedia.org/wiki/Cumulative_distribution_function) and your desired theoretical CDF? It isn't pretty but it would get the job done. You could always weight the areas that are most important. I think `fminsearch` would do the trick. (Note: you're representations appear to be the [PDF](https://en.wikipedia.org/wiki/Probability_density_function)) – SecretAgentMan Dec 11 '18 at 03:43
  • Another option is to do the algebra to go from the current parameterization to the one you want. Then you could fit with the current MATLAB functions and just transform the parameters to the desired form. – SecretAgentMan Dec 11 '18 at 03:46
  • I haven't thought of that. I just need to use the alternative models... thanks! – Oliver Amundsen Dec 11 '18 at 03:53

1 Answers1

2

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.

obchardon
  • 10,614
  • 1
  • 17
  • 33