Fit distribution to probability plot

3 次查看(过去 30 天)
Is it possible to fit a Generalized Extreme Value distribution to a probability plot? I've got 31 annual highest values that I have plotted in a probabilty plot using >>probplot(a); and now I want a distribution fitted to the data Points. How can I do this?
I've tried using gevfit to find the parameters for the distribution and i tried plotting gevpdf(a,0,107,399) in a probability plot but it didn't give me what I wanted, I just got this:
but I want something looking like this:
Thanks!

采纳的回答

Brendan Hamm
Brendan Hamm 2016-11-11
It looks like you are looking at comparing the Cumulative Distribution Function (CDF) with the Empirical Cumulative Distribution Function (ECDF) which is not the same as a probability plot.
I'll start by generating some random numbers from an EVD as I do not have your data:
rng('default')
a = gevrnd(0,107,399,100,1);
Next we need to fit the parameters of the distribution:
Mdl = fitdist(a,'GeneralizedExtremeValue'); % Returns a PD object (Requires MATLAB later than 2009)
You can then calculate the ECDF: [f,x] = ecdf(a); % plot(x,f)
Then calculate the CDF implied by the fitted parameters:
y = cdf(Mdl,x);
hold on
plot(x,y)
hold off
If you indeed wanted to look at a probability plot, you should know that by default probplot compares the data with a normal distribution. To change this, pass in the name of the distribution:
figure
probplot('extreme value',a)
  2 个评论
Gustav Lindstrand
Gustav Lindstrand 2016-11-11
Thank you so much!
Is there a way to make the fit "keep going"? Now the fit ends when my data ends, I would like it to keep going so that I can look up the value at the probability 0.99 (for example)
Brendan Hamm
Brendan Hamm 2016-11-11
The fit itself is defined on the entire support of the distribution. The PD objects are very useful for problems like what you mention. You can find a list of the methods (special functions) available for the PD objects.
methods(Mdl) % prints a list of the methods for the object.
To find the value at the 0.99 probability you would want the icdf method:
CDFval99 = icdf(Mdl,0.99)

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by