extval_mlegev
Estimates the shape, scale and location parameters for the Generalized Extreme-Value (GEV) distribution using Maximum-Likelihood Estimation (MLE).
Available in version 6.4.0 and later.
Prototype
function extval_mlegev ( x : numeric, dims [*] : integer, opt [1] : logical ) return_val : float or double
Arguments
xA variable of numeric type and any dimensionality. Most commonly, x(N), x(N,J) or x(N,J,I)
dimsThe dimension(s) of x on which to calculate the MLE of shape, scale and location. Must be consecutive and monotonically increasing. Usually, dims=0 (corresponding to 'N').
optNot used. Set to False.
Return value
The output will be double if x is double and float otherwise.
The output dimensions will be based on x's dimensions, with the 'N' dimensions removed and a rightmost dimension of size 6 added:
- If x(N) the output will be out(6)
- If x(N,J) the output will be (J,6)
- If x(N,J,I) the output will be out(J,I,6)
- If x(K,N,J,I) the output will be out(K,J,I,6)
Description
Given a series, extval_mlegev calculates the maximum-likelihood estimates (MLEs) of the parameters of the generalized extreme value distribution (GEV) and their standard errors. The parameters are: (i) shape, (ii) location (aka, center), and (iii) scale.
GEV(x) = exp(-[1+shape*((x-locp)/scale)]^(-1/shape))
Note: Several sources and software packages use different conventions for the sign of the shape parameter.
REFERENCE(S):
Algorithm AS 215: Maximum-Likelihood Estimation of the Parameters of the Generalized Extreme-Value Distribution J. R. M. Hosking Journal of the Royal Statistical Society. Series C (Applied Statistics) Vol. 34, No. 3 (1985), pp. 301-310 URL: http://www.jstor.org/stable/2347483 Code: http://ftp.uni-bayreuth.de/math/statlib/apstat/215 Wikipedia: Generalized extreme value distribution
See Also
Examples
Example 1:
flood = (/ 312,590,248,670,365,770,465,545,315,115,232,260,655,675, \
455,1020,700,570,853,395,926,99,680,121,976,916,921,191, \
187,377,128,582,744,710,520,672,645,655,918,512,255,1126, \
1386,1394,600,950,731,700,1407,1284,165,1496,809 /)
vals = extval_mlegev (flood, 0, False) ; dims=0
print(vals) ; vals(6)
The edited output is:
MLE
(0) 487.1327 location
(1) 308.7767 scale
(2) 0.0936752 shape
standard errors of each parameter
(3) 49.00172 location
(4) 35.84376 scale
(5) 0.120576 shape
The R software tool returns the following:
> install.packages("ismev")
> library(ismev)
> flood.data <- c(312,590,248,670,365,770,465,545,315,115,232,260,655,675,
+ 455,1020,700,570,853,395,926,99,680,121,976,916,921,191,
+ 187,377,128,582,744,710,520,672,645,655,918,512,255,1126,
+ 1386,1394,600,950,731,700,1407,1284,165,1496,809)
> gev.fit(flood)
or
> x <- gev.fit(flood.data)
> x
$data
[1] 312 590 248 670 365 770 465 545 315 115 232 260 655 675 455
[16] 1020 700 570 853 395 926 99 680 121 976 916 921 191 187 377
[31] 128 582 744 710 520 672 645 655 918 512 255 1126 1386 1394 600
[46] 950 731 700 1407 1284 165 1496 809
$mle
[1] 487.07202252 308.76501616 -0.09363131 <=== vals(0:2)
$cov not returned by NCL
[,1] [,2] [,3]
[1,] 2400.938119 582.553044 -2.56354404
[2,] 582.553044 1284.941994 -2.10272869
[3,] -2.563544 -2.102729 0.01453902
$se
[1] 48.9993686 35.8460876 0.1205778 <=== vals(3:5)
Not an 'exact' match .... likely different convergence criteria.
Also, as noted above, the sign of the shape parameter is different from that returned by R.
This is a matter of the definition of the GEV distribution equation.