cdfgev.RdDistribution function and quantile function of the generalized extreme-value distribution.
The generalized extreme-value distribution with location parameter \(\xi\), scale parameter \(\alpha\) and shape parameter \(k\) has distribution function $$F(x)=\exp\lbrace-\exp(-y)\rbrace$$ where $$y=-k^{-1}\log\lbrace1-k(x-\xi)/\alpha\rbrace,$$ with \(x\) bounded by \(\xi+\alpha/k\) from below if \(k<0\) and from above if \(k>0\), and quantile function $$x(F)=\xi+{\alpha\over k}\lbrace1-(-\log F)^k\rbrace.$$
Extreme-value distribution types I, II and III (Gumbel, Frechet, Weibull) correspond to shape parameter values \(k=0\), \(k<0\) and \(k>0\) respectively.
cdfgev gives the distribution function;
quagev gives the quantile function.
The functions expect the distribution parameters in a vector,
rather than as separate arguments as in the standard R
distribution functions pnorm, qnorm, etc.
Two parametrizations of the generalized extreme-value distribution are in common use. When Jenkinson (1955) introduced the distribution he wrote the distribution function in the form $$F(x) = \exp [ - \lbrace 1 - k ( x - \xi ) / \alpha) \rbrace^{1/k}].$$ and that is the form used in R package lmom. A slight inconvenience with it is that the skewness of the distribution is a decreasing function of the shape parameter \(k\). Perhaps for this reason, authors of some other R packages prefer a form in which the sign of the shape parameter \(k\) is changed and the parameters are renamed: $$F(x) = \exp [ - \lbrace 1 + \xi ( x - \mu ) / \sigma) \rbrace^{-1/\xi}].$$ Users should be able to mix functions from packages that use either form; just be aware that the sign of the shape parameter will need to be changed when converting from one form to the other (and that \(\xi\) is a location parameter in one form and a shape parameter in the other).
Jenkinson, A. F. (1955). The frequency distribution of the annual maximum (or minimum) of meteorological elements. Quarterly Journal of the Royal Meteorological Society, 81, 158-171.
# Random sample from the generalized extreme-value distribution
# with parameters xi=0, alpha=1, k=-0.5.
quagev(runif(100), c(0,1,-0.5))
#> [1] -0.391360863 -0.398291867 -0.887330566 6.391172205 -0.313776262
#> [6] 2.024029171 -0.206816407 3.481562468 -0.187977915 13.517492850
#> [11] 0.752648956 1.810077794 2.726711501 1.843781487 0.139285872
#> [16] -0.578647324 -0.738922338 1.080128900 0.807473349 1.085781915
#> [21] -0.102311313 11.887763413 1.454378567 3.418417126 13.403975317
#> [26] -0.378149069 1.128533976 0.059856751 -0.859974307 0.877698604
#> [31] 0.791351486 0.109003336 3.116967644 0.464827342 11.826360535
#> [36] -1.009077335 1.180841332 0.009237572 4.838004427 1.208160439
#> [41] 1.132123436 1.781944616 0.558754487 -0.327566866 0.433391881
#> [46] 0.139269580 1.541630994 0.981722214 0.079156696 7.834086091
#> [51] -0.180657095 -0.843702095 0.693563514 -0.379752549 -0.610781029
#> [56] 5.915435885 2.249063537 1.800049062 0.519663139 0.574142339
#> [61] -0.693723333 0.056454520 -0.491679080 1.287925182 1.191397409
#> [66] 6.512482017 -0.432768029 9.204027883 0.052949018 1.049071067
#> [71] 2.416585204 -0.770381952 0.498289359 1.849892175 0.193276748
#> [76] 0.596413273 -0.413639933 -0.926796613 9.403232479 -0.476136094
#> [81] 1.994790243 3.740948271 2.732577778 0.823017728 4.397069640
#> [86] -0.903470670 -0.596056734 -0.699250612 1.326100549 0.105764267
#> [91] -0.788128305 -0.609087698 5.861618317 -0.383475140 1.137559047
#> [96] -0.413957807 0.581125858 2.596250513 -0.606258867 -0.273886755