Skip to contents

Estimates the parameters of the generalized extreme value (GEV) distribution by maximizing the generalized log‐likelihood, which incorporates a Beta prior on the shape parameter. Initial parameter estimates are obtained using the method of L‐moments and optimization is performed via stats::nlminb() with repeated perturbations if needed.

For NS-FFA: To estimate parameters for a nonstationary model, include the observation years (ns_years) and the nonstationary model structure (ns_structure).

Usage

fit_gmle(data, prior, ns_years = NULL, ns_structure = NULL)

Arguments

data

Numeric vector of observed annual maximum series values. Must be strictly positive, finite, and not missing.

prior

Numeric vector of length 2. Specifies the parameters of the Beta prior for the shape parameter \(\kappa\).

ns_years

For NS-FFA only: Numeric vector of observation years corresponding to data. Must be the same length as data and strictly increasing.

ns_structure

For NS-FFA only: Named list indicating which distribution parameters are modeled as nonstationary. Must contain two logical scalars:

  • location: If TRUE, the location parameter has a linear temporal trend.

  • scale: If TRUE, the scale parameter has a linear temporal trend.

Value

A list containing the results of parameter estimation:

  • data: The data argument.

  • prior: The prior argument.

  • ns_years: The ns_years argument, if given.

  • ns_structure: The ns_structure argument, if given.

  • method: "GMLE".

  • params: Numeric vector of estimated parameters.

  • mll: The maximum value of the generalized log‐likelihood.

Details

  1. Calls fit_lmoments() on the data to obtain initial parameter estimates.

  2. Initializes trend parameters to zero if necessary.

  3. Defines an objective function using utils_generalized_likelihood().

  4. Runs stats::nlminb() with box constraints. Attempts minimization up to 100 times.

References

El Adlouni, S., Ouarda, T.B.M.J., Zhang, X., Roy, R., Bobee, B., 2007. Generalized maximum likelihood estimators for the nonstationary generalized extreme value model. Water Resources Research 43 (3), 1–13. doi:10.1029/2005WR004545

Martins, E. S., and Stedinger, J. R. (2000). Generalized maximum-likelihood generalized extreme-value quantile estimators for hydrologic data. Water Resources Research, 36(3), 737–744. doi:10.1029/1999WR900330

Examples

data <- rnorm(n = 100, mean = 100, sd = 10)
prior <- c(6, 9)
ns_years <- seq(from = 1901, to = 2000)
ns_structure <- list(location = TRUE, scale = FALSE)
fit_gmle(data, prior, ns_years, ns_structure)
#> $data
#>   [1]  94.02569 107.12776  93.87376 107.84242  97.69873 125.24530 103.56465
#>   [8]  93.36118 109.48751 103.26694  96.17233 113.48133  86.81124 108.93587
#>  [15] 112.09918  97.40808  85.91189 106.89636  99.71902  80.10229  92.36063
#>  [22]  83.85098 121.10798 108.58506 108.31253  94.26097 100.53390 120.76441
#>  [29] 107.26516 109.96803  91.08321 105.39807  99.44333 100.16600 118.61687
#>  [36] 110.21902 114.73549 100.36435  86.31768 109.19317 116.28756 101.60625
#>  [43]  90.94688 102.68745  97.00890  89.48579 117.41882  98.48603  99.31366
#>  [50]  86.91908 101.22587 118.70062  97.80619 109.65154 107.82251  88.81587
#>  [57]  75.86941  85.69462  97.30973  99.80566 112.09757  91.36437  95.86744
#>  [64]  92.77654 104.87393 102.51375 100.99291  95.86417  99.78147 104.83921
#>  [71] 110.42958 109.35107  97.67290 104.29871 109.35454  92.24086 108.62367
#>  [78]  85.20797  90.62383 102.25252 105.23610  94.18402 101.79172 103.95063
#>  [85] 112.68783  95.59487  92.48007  94.78395  94.88289 106.87342 107.67279
#>  [92] 115.10075 114.32144 118.17319 100.70136 102.34274  96.87547 115.08114
#>  [99] 108.78293 105.86041
#> 
#> $distribution
#> [1] "GEV"
#> 
#> $ns_years
#>   [1] 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915
#>  [16] 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930
#>  [31] 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945
#>  [46] 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960
#>  [61] 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975
#>  [76] 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990
#>  [91] 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000
#> 
#> $ns_structure
#> $ns_structure$location
#> [1] TRUE
#> 
#> $ns_structure$scale
#> [1] FALSE
#> 
#> 
#> $prior
#> [1] 6 9
#> 
#> $method
#> [1] "GMLE"
#> 
#> $params
#> [1] 94.4628866  4.2539652 10.1562451  0.1055145
#> 
#> $mll
#> [1] -269.0837
#>