Type: Package
Title: Generalized L-Moments Estimation for Extreme Value Distributions
Version: 1.3.1
Description: Provides generalized L-moments estimation methods for the generalized extreme value ('GEV') distribution. Implements both stationary 'GEV' and non-stationary 'GEV11' models where location and scale parameters vary with time. Includes various penalty functions ('Martins'-'Stedinger', Park, Cannon, 'Coles'-Dixon) for shape parameter regularization. Also provides model averaging estimation ('ma.gev') that combines MLE and L-moment methods with multiple weighting schemes for robust high quantile estimation. The 'GLME' methodology is described in Shin et al. (2025a) <doi:10.48550/arXiv.2512.20385>. The non-stationary L-moment method is based on Shin et al. (2025b) <doi:10.1007/s42952-025-00325-3>. The model averaging method is described in Shin et al. (2026) <doi:10.1007/s00477-025-03167-x>. See also 'Hosking' (1990) <doi:10.1111/j.2517-6161.1990.tb01775.x> for L-moments theory and 'Martins' and 'Stedinger' (2000) <doi:10.1029/1999WR900330> for penalized likelihood methods.
License: GPL (≥ 3)
URL: https://github.com/sygstat/GLmom
BugReports: https://github.com/sygstat/GLmom/issues
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.3
Imports: lmomco, nleqslv, stats, methods, robustbase, ismev, Rsolnp, zoo, graphics
Depends: R (≥ 3.5.0)
NeedsCompilation: no
Packaged: 2026-02-23 00:42:17 UTC; energy
Author: Yonggwan Shin ORCID iD [aut, cre], Seokkap Ko ORCID iD [aut, ctb], Jihong Park ORCID iD [ctb], Yire Shin ORCID iD [aut, dtc], Jeong-Soo Park ORCID iD [aut, ths]
Maintainer: Yonggwan Shin <syg.stat@etri.re.kr>
Repository: CRAN
Date/Publication: 2026-02-27 20:02:11 UTC

Beta function integrand for penalty calculation

Description

Beta function integrand for penalty calculation

Usage

Befun(w, al = al, bl = bl, p = p, q = q)

Arguments

w

Integration variable.

al

Lower bound.

bl

Upper bound.

p

Shape parameter p.

q

Shape parameter q.

Value

Integrand value.


Martins-Stedinger prior function

Description

Computes the Martins-Stedinger Beta(6,9) prior probability for the GEV shape parameter on the interval [-0.5, 0.5].

Usage

MS_pk(para = para, p = 6, q = 9)

Arguments

para

A vector of GEV parameters (location, scale, shape).

p

Shape parameter for beta distribution (default 6).

q

Shape parameter for beta distribution (default 9).

Value

Prior probability value (scalar).

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Martins, E. S. & 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

See Also

pk.beta.stnary for the adaptive beta penalty, glme.gev which uses these penalty functions.

Examples

# Evaluate MS prior at xi = -0.2
MS_pk(para = c(100, 20, -0.2))


Phliu Agrometeorological Station Data

Description

Climate or meteorological data from the Phliu Agrometeorological Station for extreme value analysis.

Usage

PhliuAgromet

Format

A data frame with 40 rows and 9 columns:

Station.ID

Station identifier (character)

year

Year of observation (numeric, 1984-2023)

prec

Annual maximum daily precipitation in mm (numeric)

Name

Station name (character)

zone

Climate zone code (character)

latitude

Station latitude in degrees (numeric)

longitude

Station longitude in degrees (numeric)

Starting.year

Record start year (integer)

Ending.year

Record end year (numeric)

Source

Phliu Agrometeorological Station, Thailand.

References

Shin, Y., Shin, Y., Park, J., & Park, J. S. (2025). Generalized method of L-moment estimation for stationary and nonstationary extreme value models. arXiv preprint arXiv:2512.20385. doi:10.48550/arXiv.2512.20385

Examples

data(PhliuAgromet)
head(PhliuAgromet)


Prescott-Walden expected information matrix for GEV with fixed xi

Description

Internal function that computes the Prescott-Walden expected information (Hessian) matrix for GEV parameters (mu, sigma) with fixed xi.

Usage

PrescottW(par2 = NULL, xifix = NULL, nsam = NULL)

Arguments

par2

Numeric vector of (mu, sigma) estimates.

xifix

Fixed shape parameter value.

nsam

Sample size.

Value

A 2x2 expected information matrix.


Trehafod River Flow Data

Description

Annual maximum river flow data from the Trehafod gauging station in Wales, UK. This dataset is commonly used for demonstrating non-stationary extreme value analysis methods.

Usage

Trehafod

Format

A data frame with 53 rows and 2 columns:

Year

Year of observation (integer, 1968-2021)

r1

Annual maximum river flow in cubic meters per second (m^3/s)

Source

UK National River Flow Archive.

References

Shin, Y., Shin, Y. & Park, J.-S. (2025). Building nonstationary extreme value model using L-moments. Journal of the Korean Statistical Society, 54, 947-970. doi:10.1007/s42952-025-00325-3

Examples

data(Trehafod)
head(Trehafod)


# Fit non-stationary GEV11 model
result <- glme.gev11(Trehafod$r1, ntry = 5)
print(result$para.glme)



Asymptotic variance of model-averaged quantile estimates

Description

Internal function that computes asymptotic standard errors for model-averaged quantile estimates under both fixed-weight and random-weight assumptions.

Usage

asymp.var(mywt, covint, qqq = NULL, order = 2)

Arguments

mywt

Weight computation result list from weight.com().

covint

Array (2 x 2 x numk) of interpolated covariance matrices.

qqq

Numeric vector of quantile probabilities.

order

Moving average order for smoothing. Default is 2.

Value

A list containing:

fin.se.MA.qua

SE under fixed weights for MA

fin.se.bma.qua

SE under fixed weights for BMA

adj.se.MA.qua

SE under random weights for MA

adj.se.bma.qua

SE under random weights for BMA

MatC

Cross-covariance array (numk x numk x numq)


Bangkok Maximum Rainfall Data

Description

Annual maximum daily rainfall data from Bangkok, Thailand. This dataset is used for demonstrating model averaging methods for high quantile estimation in extreme value analysis.

Usage

bangkok

Format

A data frame with 58 rows and 5 columns:

X1

Annual maximum daily rainfall in mm (numeric)

X2

2nd largest annual daily rainfall in mm (numeric)

X3

3rd largest annual daily rainfall in mm (numeric)

X4

4th largest annual daily rainfall in mm (numeric)

X5

5th largest annual daily rainfall in mm (numeric)

Source

Thai Meteorological Department (TMD; https://www.tmd.go.th)

References

Shin, Y., Shin, Y., & Park, J. S. (2026). Model averaging with mixed criteria for estimating high quantiles of extreme values: Application to heavy rainfall. Stochastic Environmental Research and Risk Assessment, 40(2), 47. doi:10.1007/s00477-025-03167-x

Examples

data(bangkok)
head(bangkok)

# Estimate high quantiles using model averaging
result <- ma.gev(bangkok$X1, quant = c(0.99, 0.995))
print(result$qua.ma)


Select candidate shape parameter values for model averaging

Description

Internal function that selects K candidate shape parameter (xi) values from the profile likelihood confidence interval. Falls back to bootstrap LME quantiles if the profile likelihood fails.

Usage

cand.xi(
  data,
  hosking = NULL,
  mle = NULL,
  pick0 = 0.95,
  nint = 256,
  start = "mle",
  numk = NULL,
  figure = TRUE,
  cov.lme = NULL,
  bma = FALSE,
  pen = "beta"
)

Arguments

data

Numeric vector of data.

hosking

List containing LME results and bootstrap information.

mle

MLE parameter estimates (mu, sigma, xi) in Hosking style.

pick0

Confidence level for the profile CI. Default is 0.95.

nint

Number of points for profile likelihood evaluation. Default is 256.

start

Starting method: "mle" (default), "lme", or "mix".

numk

Number of candidate submodels.

figure

Logical. Whether to produce a profile likelihood plot (default TRUE).

cov.lme

Pre-computed LME covariance (default NULL).

bma

Logical. Whether BMA is being used (default FALSE).

pen

BMA prior type (default "beta").

Value

A list containing:

kpar

Numeric vector of K candidate xi values

start

Starting method actually used

get.ci

Profile CI result (if start="mle")

ymin

Minimum y value for plotting (if start="mle")


Coles-Dixon Penalty Function

Description

Computes the Coles-Dixon prior probability for the shape parameter.

Usage

cd.hos(sxi)

Arguments

sxi

Shape parameter value (Hosking style, negative for heavy tails).

Value

Prior probability value.


Compute generalized L-moment distance probabilities

Description

Internal function that computes generalized L-moment distance and median-based distance probabilities for each candidate submodel.

Usage

com.prdist(
  data = NULL,
  numk = NULL,
  kfix = NULL,
  Vinv = NULL,
  detV = NULL,
  numom = NULL,
  hosking = NULL,
  trim = NULL,
  cov.type = "lambda"
)

Arguments

data

Numeric vector of data.

numk

Number of candidate submodels.

kfix

List of submodel fitting results.

Vinv

Inverse of the L-moment covariance matrix.

detV

Determinant of the L-moment covariance matrix.

numom

Number of L-moments.

hosking

List containing LME results.

trim

Left trimming level.

cov.type

Covariance type: "ratio" or "lambda" (default "lambda").

Value

A list containing:

prob.mtx

Matrix (numk x 2) of probabilities (col 1 = gLd, col 2 = med)

gdd

Matrix (numk x 2) of generalized distances


Compute profile likelihood confidence intervals

Description

Internal function that extracts confidence intervals from a profile log-likelihood curve at specified confidence levels.

Usage

comp.prof.ci(d, v, conf = NULL)

Arguments

d

Data frame with columns x (xi values) and v (log-likelihood).

v

Numeric vector of log-likelihood values.

conf

Numeric vector of confidence levels (e.g., 0.95).

Value

A list containing:

vmax

Maximum log-likelihood value

nllh

Same as vmax

xmax

xi value at maximum likelihood

ci1

Lower CI bounds for each confidence level

ci2

Upper CI bounds for each confidence level

ci_length

CI lengths for each confidence level


Construct covariance matrix C for model averaging SE

Description

Internal function that constructs the cross-covariance matrix between submodel quantile estimators using the delta method and quantile correlation approximation.

Usage

cons.MatC(mywt, cov22, quant)

Arguments

mywt

Weight computation result list from weight.com().

cov22

Array of 2x2 covariance matrices for each submodel (2 x 2 x numk).

quant

Numeric vector of quantile probabilities.

Value

A list containing:

MatC

Array (numk x numk x numq) of cross-covariance values

fin.se

SE under fixed weights for MA

fin.se.bma

SE under fixed weights for BMA

numk

Number of submodels

numq

Number of quantiles

wtgd

MA weights

bmaw

BMA weights


Dirichlet covariance matrix for weights

Description

Internal function that computes the covariance matrix of weights assuming a Dirichlet-type distribution.

Usage

cov.dir(wtgd)

Arguments

wtgd

Numeric vector of model weights.

Value

A (numk x numk) covariance matrix.


Interpolate missing covariance matrices across submodels

Description

Internal function that fills in missing 2x2 covariance matrices for submodels using natural spline interpolation across the shape parameter.

Usage

cov.interp(numk, para3, cov2 = NULL)

Arguments

numk

Number of candidate submodels.

para3

Matrix (numk x 3) of submodel parameters.

cov2

List of 2x2 covariance matrices (one per submodel).

Value

Array (2 x 2 x numk) of covariance matrices with missing values filled by interpolation.


Delta method variance and cross-covariance for GEV quantiles

Description

Internal function that computes delta method variances for GEV quantile estimates. Can compute either the variance from a full 3-parameter MLE (d3yes=TRUE) or the cross-covariance between two submodels with fixed xi (d3yes=FALSE).

Usage

delta.gev(
  gevf3 = NULL,
  mle3i = NULL,
  cov2i = NULL,
  mle3j = NULL,
  cov2j = NULL,
  quant = NULL,
  d3yes = FALSE
)

Arguments

gevf3

Full MLE result list with cov and mle (used when d3yes=TRUE).

mle3i

Parameter vector for submodel i (used when d3yes=FALSE).

cov2i

2x2 covariance matrix for submodel i.

mle3j

Parameter vector for submodel j.

cov2j

2x2 covariance matrix for submodel j.

quant

Numeric vector of quantile probabilities.

d3yes

Logical. If TRUE, compute 3-parameter delta method variance.

Value

A list containing:

v3

Variance for each quantile (if d3yes=TRUE)

covij

Cross-covariance for each quantile (if d3yes=FALSE)


Fit submodels and compute distance-based probabilities

Description

Internal function that fits GEV submodels with fixed xi for each candidate and computes generalized L-moment distance or median-based probabilities for weight construction.

Usage

dist.noboot(
  data = NULL,
  numk = NULL,
  hosking = NULL,
  boot.lme = TRUE,
  kpar = NULL,
  numom = NULL,
  ntry = 5,
  varcom = NULL,
  cov.lme = NULL,
  trim = NULL,
  cov.type = "lambda"
)

Arguments

data

Numeric vector of data.

numk

Number of candidate submodels.

hosking

List containing LME results and bootstrap information.

boot.lme

Logical. Whether bootstrap LME was performed (default TRUE).

kpar

Numeric vector of candidate xi values.

numom

Number of L-moments to use.

ntry

Number of optimization attempts. Default is 5.

varcom

Logical. Whether to compute variance.

cov.lme

Pre-computed LME covariance (default NULL).

trim

Left trimming level.

cov.type

Covariance type: "ratio" or "lambda" (default "lambda").

Value

A list containing:

aic

AIC values for each submodel

mle3

Matrix (numk x 3) of submodel parameter estimates

kfix

List of submodel fitting results

cov2

List of 2x2 covariance matrices (if varcom=TRUE)

prob.mtx

Matrix (numk x 3) of distance-based probabilities

gdd

Matrix (numk x 2) of generalized distances


Empirical prior for BMA based on MLE and LME

Description

Internal function that computes an empirical prior distribution for the shape parameter based on the range between MLE and LME estimates.

Usage

emp.prior(mle3, mle, lme)

Arguments

mle3

Matrix of candidate submodel parameters (numk x 3).

mle

MLE parameter estimates (mu, sigma, xi).

lme

LME parameter estimates (mu, sigma, xi).

Value

Numeric vector of prior probability values for each candidate.


Comprehensive Non-stationary GEV Estimation

Description

Estimates parameters of a non-stationary GEV distribution using multiple methods: Weighted Least Squares (WLS), GN16 method, and the proposed L-moment method from Shin et al. (2025, J. Korean Stat. Soc.).

This is a convenience wrapper around glme.gev11 with pen="no", providing compatibility with the original nsgev package interface.

Usage

gado.prop_11(xdat, ntry = 20, ftol = 1e-06)

Arguments

xdat

A numeric vector of data to be fitted.

ntry

Number of attempts for optimization (default 20).

ftol

Function tolerance for optimization (default 1e-6).

Value

A list containing:

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y. & Park, J.-S. (2025). Building nonstationary extreme value model using L-moments. Journal of the Korean Statistical Society, 54, 947-970. doi:10.1007/s42952-025-00325-3

See Also

glme.gev11 for the full GLME method with penalty functions, nsgev for the simple interface.

Examples

data(Trehafod)
result <- gado.prop_11(Trehafod$r1, ntry = 5)
print(result$para.prop)
print(result$lme.sta)


MLE for GEV distribution using constrained optimization

Description

Internal function that computes maximum likelihood estimates of GEV parameters using the Rsolnp constrained optimizer with multiple random starting points.

Usage

gev.max(xdat, ntry = 5)

Arguments

xdat

Numeric vector of data.

ntry

Number of random starting points for optimization. Default is 5.

Value

A list containing:

nsample

Sample size

conv

Convergence status (0 = success)

nllh

Negative log-likelihood at the optimum

mle

MLE estimates (mu, sigma, xi) in Hosking style


Modified profile likelihood for GEV shape parameter

Description

Internal function that computes the profile log-likelihood for the GEV shape parameter with linear extrapolation beyond the observed range. Used for constructing confidence intervals on xi.

Usage

gev.profxi.mdfy(
  data = NULL,
  mle = NULL,
  xlow,
  xup,
  pick.v = NULL,
  nint = 256,
  figure = FALSE
)

Arguments

data

Numeric vector of data.

mle

MLE parameter estimates (mu, sigma, xi) in Coles parameterization.

xlow

Lower bound for xi search.

xup

Upper bound for xi search.

pick.v

Numeric vector of confidence levels for CI computation.

nint

Number of grid points. Default is 256.

figure

Logical. Whether to plot the profile likelihood. Default is FALSE.

Value

A list containing:

fail

Logical. TRUE if profile likelihood is degenerate

start

Starting method recommendation

w1

Profile CI results from comp.prof.ci()

ymin

Minimum y value for plotting

ymax

Maximum y value for plotting


MLE with return level and delta method SE

Description

Internal function that computes GEV MLE using both constrained optimization (solnp) and ismev::gev.fit, selects the better fit, and returns the covariance matrix for delta method SE.

Usage

gev.rl.delta(data, ntry = 5, quant)

Arguments

data

Numeric vector of data.

ntry

Number of optimization attempts. Default is 5.

quant

Numeric vector of probabilities for quantile estimation.

Value

A list containing:

nllh

Negative log-likelihood

mle

MLE estimates (mu, sigma, xi) in Hosking style

qua.mle

Quantile estimates at quant probabilities

data

Input data

cov

3x3 covariance matrix from MLE

quant

Input quantile probabilities


MLE for GEV with fixed shape parameter (single candidate)

Description

Internal function that computes MLE of GEV location and scale parameters with a fixed shape parameter using L-BFGS-B optimization. Optionally computes Prescott-Walden Hessian for variance estimation.

Usage

gev.xifix.sing(xdat = NULL, xifix = -0.1, ntry = 5, varcom = NULL)

Arguments

xdat

Numeric vector of data.

xifix

Fixed shape parameter value. Default is -0.1.

ntry

Number of optimization attempts. Default is 5.

varcom

Logical. If TRUE, computes Prescott-Walden covariance matrix.

Value

A list of class "gev.xifix" containing:

conv

Convergence status (0 = success)

nllh

Negative log-likelihood at the optimum

mle

MLE estimates (mu, sigma, xi)

cov

2x2 covariance matrix (if varcom=TRUE)


GEV negative log-likelihood with fixed xi

Description

Internal function that computes the negative log-likelihood for the GEV distribution with a fixed shape parameter (Hosking parameterization).

Usage

gev.xilik(a, xifix = NULL, xdat = NULL)

Arguments

a

Numeric vector of (mu, sigma).

xifix

Fixed shape parameter value.

xdat

Numeric vector of data.

Value

Negative log-likelihood value (scalar). Returns 10^6 if invalid.


GEV negative log-likelihood with fixed xi (wrapper)

Description

Internal wrapper function that calls gev.xilik().

Usage

gev.xilik2(a, xifix = xifix, xdat = xdat)

Arguments

a

Numeric vector of (mu, sigma).

xifix

Fixed shape parameter value.

xdat

Numeric vector of data.

Value

Negative log-likelihood value (scalar).


Calculate GLD covariance for GEV11 model

Description

Internal function that computes the generalized L-moment distance covariance matrix for standardized residuals from the GEV11 model. Uses bootstrap if the direct L-moment covariance matrix is singular.

Usage

gev11.GLD(par = NULL, xdat = NULL)

Arguments

par

Numeric vector of GEV11 parameters (mu0, mu1, sigma0, sigma1, xi).

xdat

Numeric vector of data.

Value

A list containing:

covinv

3x3 inverse covariance matrix of L-moments

lcovdet

Log determinant of the covariance matrix


Initialize parameters for GEV with fixed xi

Description

Internal function that generates initial (mu, sigma) values for optimization with fixed shape parameter, using Gumbel L-moment estimates and random perturbations.

Usage

ginit.xifix(data, ntry)

Arguments

data

Numeric vector of data.

ntry

Number of initial parameter sets to generate.

Value

A matrix with ntry rows and 2 columns (mu, sigma).


Generalized L-moments estimation for generalized extreme value distribution

Description

This function estimates the Generalized L-moments of Generalized Extreme Value distribution.

Usage

glme.gev(
  xdat,
  ntry = 10,
  pen = "beta",
  pen.choice = NULL,
  mu = -0.5,
  std = 0.2,
  p = 6,
  c1 = 10,
  c2 = 5
)

Arguments

xdat

A numeric vector of data to be fitted.

ntry

Number of attempts for parameter estimation. Higher values increase the chance of finding a more accurate estimate by trying different initial conditions.

pen

Type of penalty function: Choose among "norm", "beta" (default), "ms", "park", "cannon", "cd", and "no" (without penalty function).

pen.choice

Choice number of penalty function specifying hyperparameters. For "beta": 1-6 correspond to different (p, c1, c2) combinations. For "norm": 1-4 correspond to different (mu, std) combinations.

mu

Mean hyperparameter for "norm" penalty function (default -0.5).

std

Standard deviation hyperparameter for "norm" penalty function (default 0.2).

p

Shape hyperparameter for "beta" penalty function (default 6).

c1

Scaling hyperparameter for "beta" penalty function (default 10).

c2

Upper limit hyperparameter for "beta" penalty function (default 5).

Details

The equations for the L-moments for LME of the GEVD are

\underline{\bf \lambda} - \underline{\bf l} = \underline{\bf 0},

where \underline{\bf \lambda} =(\lambda_1,\; \lambda_2,\; \lambda_3)^t and \underline{\bf l} =(l_1,\; l_2,\; l_3)^t. Next, we define the generalized L-moments distance (GLD) as;

(\underline{\bf \lambda} -\underline{\bf l})^t V^{-1} (\underline{\bf \lambda} -\underline{\bf l}),

where V is the variance-covariance matrix of the sample L-moments up to the third order.

Value

The glme.gev function returns a list containing the following elements:

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y., Park, J. & Park, J.-S. (2025). Generalized method of L-moment estimation for stationary and nonstationary extreme value models. arXiv preprint arXiv:2512.20385. doi:10.48550/arXiv.2512.20385

See Also

glme.gev11 for non-stationary GEV estimation, ma.gev for model averaging estimation, glme.like for the objective function, quagev.NS for quantile computation.

Examples

# Load example streamflow data
data(streamflow)
x <- streamflow$r1

# Estimate GEV parameters using beta penalty (default)
result <- glme.gev(x, ntry = 5)
print(result$para.glme)

# Using Martins-Stedinger penalty
result_ms <- glme.gev(x, ntry = 5, pen = "ms")
print(result_ms$para.glme)


Generalized L-moments estimation for non-stationary GEV11 model

Description

This function estimates parameters of the non-stationary GEV11 model where mu(t) = mu0 + mu1*t and sigma(t) = exp(sigma0 + sigma1*t).

Usage

glme.gev11(
  xdat,
  ntry = 10,
  ftol = 1e-06,
  init.rob = TRUE,
  glme.pre = "wls",
  opt.choose = "gof",
  pen = "beta",
  pen.choice = NULL,
  mu = -0.55,
  std = 0.3,
  p = 6,
  c1 = 10,
  c2 = 5
)

Arguments

xdat

A numeric vector of data to be fitted.

ntry

Number of attempts for parameter estimation (default 10).

ftol

Tolerance for convergence (default 1e-6).

init.rob

Use robust regression for initialization (default TRUE).

glme.pre

Pre-estimation method: "wls" (default) or "gado".

opt.choose

Selection criterion: "gof" (default, goodness-of-fit) or "nllh" (negative log-likelihood).

pen

Type of penalty function: "norm", "beta" (default), "ms", "park", "cannon", "cd", or "no".

pen.choice

Choice number for penalty hyperparameters (default 6 for beta).

mu

Mean for normal penalty (default -0.55).

std

Std for normal penalty (default 0.3).

p

Shape for beta penalty (default 6).

c1

Scaling for beta penalty (default 10).

c2

Limit for beta penalty (default 5).

Value

A list containing:

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y., Park, J. & Park, J.-S. (2025). Generalized method of L-moment estimation for stationary and nonstationary extreme value models. arXiv preprint arXiv:2512.20385. doi:10.48550/arXiv.2512.20385

Shin, Y., Shin, Y. & Park, J.-S. (2025). Building nonstationary extreme value model using L-moments. Journal of the Korean Statistical Society, 54, 947-970. doi:10.1007/s42952-025-00325-3

See Also

glme.gev for stationary GEV estimation, nsgev for the pure L-moment wrapper (no penalty), quagev.NS for non-stationary quantile computation.

Examples

# Load example streamflow data
data(streamflow)
x <- streamflow$r1


# Estimate non-stationary GEV11 parameters
result <- glme.gev11(x, ntry = 5)
print(result$para.glme)  # Proposed GLME estimates
print(result$para.lme)  # L-moment based estimates



Calculate the likelihood for Generalized L-moments estimation of GEV distribution

Description

This function calculates the likelihood (or more precisely, a penalized negative log-likelihood) for the Generalized L-moments estimation of the Generalized Extreme Value (GEV) distribution.

Usage

glme.like(
  par = par,
  xdat = xdat,
  slmgev = slmgev,
  covinv = covinv,
  lcovdet = lcovdet,
  mu = mu,
  std = std,
  lme = lme,
  pen = pen,
  p = p,
  c1 = c1,
  c2 = c2
)

Arguments

par

A vector of GEV parameters (location, scale, shape).

xdat

A numeric vector of data.

slmgev

Sample L-moments of the data.

covinv

Inverse of the covariance matrix of the sample L-moments.

lcovdet

Log determinant of the covariance matrix.

mu

Mean for the normal penalization (used when pen='norm').

std

Standard deviation for the normal penalization (used when pen='norm').

lme

L-moment estimates of the parameters.

pen

Penalization method: 'norm', 'beta', 'ms', 'park', 'cannon', 'cd', or 'no'.

p

Shape parameter for beta penalty.

c1

Scaling parameter for beta penalty.

c2

Upper limit parameter for beta penalty.

Details

The function performs the following steps: 1. Checks if the parameters are within valid ranges. 2. Calculates the expected L-moments based on the current parameters. 3. Computes the difference between expected and sample L-moments. 4. Calculates the generalized L-moments distance. 5. Applies a penalization term based on the specified method. 6. Returns the sum of the L-moments distance and the penalization term.

Value

A numeric value representing the penalized negative log-likelihood. A lower value indicates a better fit.

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y., Park, J. & Park, J.-S. (2025). Generalized method of L-moment estimation for stationary and nonstationary extreme value models. arXiv preprint arXiv:2512.20385. doi:10.48550/arXiv.2512.20385

See Also

glme.gev which calls this function for optimization.

Examples

data(streamflow)
x <- streamflow$r1
slm <- lmomco::lmoms(x, nmom = 3)
cov_mat <- lmomco::lmoms.cov(x, nmom = 3)
lme_par <- lmomco::pargev(slm)$para
glme.like(par = lme_par, xdat = x, slmgev = slm,
          covinv = solve(cov_mat), lcovdet = log(det(cov_mat)),
          mu = -0.5, std = 0.2, lme = lme_par, pen = "beta",
          p = 6, c1 = 10, c2 = 5)


Goodness-of-fit based on exceedance counts

Description

Internal function that computes goodness-of-fit by comparing observed vs expected exceedances above return level quantiles for multiple return periods.

Usage

gof.ene_all(xdat, vecT = c(5, 10, 20, 40, 80), para = NULL, model = NULL)

Arguments

xdat

Numeric vector of data.

vecT

Numeric vector of return periods. Default is c(5, 10, 20, 40, 80).

para

Parameter vector for the model.

model

Model type: "gev11", "gev10", "gev20", or "gev00".

Value

Sum of absolute relative exceedance errors (scalar).


Haenam Maximum Rainfall Data

Description

Annual maximum daily rainfall data from Haenam, South Korea. This dataset is used for demonstrating model averaging methods for high quantile estimation in extreme value analysis.

Usage

haenam

Format

A data frame with 52 rows and 2 columns:

year

Year of observation (integer, 1971-2022)

X1

Annual maximum daily rainfall in mm (numeric)

Source

Korea Meteorological Administration (KMA; https://www.weather.go.kr)

References

Shin, Y., Shin, Y., & Park, J. S. (2026). Model averaging with mixed criteria for estimating high quantiles of extreme values: Application to heavy rainfall. Stochastic Environmental Research and Risk Assessment, 40(2), 47. doi:10.1007/s00477-025-03167-x

Examples

data(haenam)
head(haenam)

# Estimate high quantiles using model averaging
result <- ma.gev(haenam$X1, quant = c(0.98, 0.99, 0.995))
print(result$qua.ma)


Initialize parameters for GEV MLE estimation

Description

This function initializes parameters for GEV maximum likelihood estimation.

Usage

init.gevmax(data = NULL, ntry = NULL)

Arguments

data

A numeric vector of data to be fitted.

ntry

Number of initial parameter sets to generate.

Details

The function generates 'ntry' sets of initial parameters for the GEV distribution. It uses L-moment estimates as a starting point and then generates additional sets of parameters using random perturbations.

Value

A matrix with 'ntry' rows and 3 columns, where each row represents a set of initial parameters (location, scale, shape) for the GEV distribution.

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park


Initialize random starting values for GLME optimization

Description

Generates multiple random starting parameter sets for multi-start optimization in GLME estimation. Uses L-moment estimates as a base and adds random perturbations.

Usage

init.glme(xdat, ntry = ntry)

Arguments

xdat

A numeric vector of data to be fitted.

ntry

Number of initial parameter sets to generate.

Value

A matrix with ntry rows and 3 columns (location, scale, shape), where each row is a candidate starting point for optimization.

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

See Also

glme.gev which uses this function internally.

Examples

data(streamflow)
inits <- init.glme(streamflow$r1, ntry = 5)
print(inits)


Initialize parameters for multi-start GEV11 optimization

Description

Internal function that generates initial parameter sets (mu0, sigma0, xi) for multi-start optimization in the GEV11 model. Uses stationary L-moment estimates and random perturbations.

Usage

init.glme.gev11(data, ntry = 10, pretheta = NULL)

Arguments

data

Numeric vector of data.

ntry

Number of initial parameter sets to generate. Default is 10.

pretheta

Pre-estimated parameter vector (mu0, mu1, sigma0, sigma1, xi).

Value

A matrix with ntry rows and 3 columns (mu0, log(sigma), xi).


Check if a number is odd

Description

Check if a number is odd

Usage

is.odd.me(x)

Arguments

x

Integer value.

Value

Logical. TRUE if x is odd, FALSE otherwise.


L-moment estimation with bootstrap standard errors

Description

Internal function that computes L-moment estimates of GEV parameters and optionally performs bootstrap resampling to obtain covariance matrices and standard errors for quantile estimates.

Usage

lme.boots(data, B = NULL, quant, boot = TRUE, trim = NULL)

Arguments

data

Numeric vector of data.

B

Number of bootstrap samples.

quant

Numeric vector of probabilities for quantile estimation.

boot

Logical. If TRUE (default), perform bootstrap.

trim

Left trimming level for L-moments (integer). Default is NULL (0).

Value

A list containing:

lme

L-moment estimates (mu, sigma, xi)

qua.lme

Quantile estimates from LME

quant

Input quantile probabilities

cov.par

3x3 covariance of bootstrap parameter estimates (if boot=TRUE)

cov.lambda

3x3 covariance of bootstrap L-moments (if boot=TRUE)

qua.lme.se

SE of quantile estimates from bootstrap (if boot=TRUE)


Modified L-moments calculation with optional trimming

Description

Internal function that computes sample L-moments with an option for trimmed L-moments (TLmoms with left trimming). Includes a fail-safe mode for use in optimization loops.

Usage

lmoms.md.park(x, nmom = 5, mtrim = FALSE, no.stop = FALSE, vecit = FALSE)

Arguments

x

Numeric vector of data.

nmom

Number of L-moments to compute. Default is 5.

mtrim

Logical. If TRUE, use left-trimmed L-moments (trim=5). Default is FALSE.

no.stop

Logical. If TRUE, return failure indicator instead of stopping. Default is FALSE.

vecit

Logical. If TRUE, return as a vector. Default is FALSE.

Value

A list (from lmomco::TLmoms()) with an additional ifail component (0 = success, 1 = failure).


Model Averaging for GEV High Quantile Estimation

Description

This function estimates high quantiles of the Generalized Extreme Value (GEV) distribution using model averaging with mixed criteria. It combines Maximum Likelihood Estimation (MLE) and L-moment Estimation (LME) to construct candidate submodels and assign weights effectively.

Usage

ma.gev(
  data = NULL,
  quant = c(0.98, 0.99, 0.995),
  weight = "like1",
  numk = 12,
  B = 200,
  varcom = TRUE,
  trim = 0,
  fig = FALSE,
  bma = FALSE,
  pen = "norm",
  CD = FALSE,
  remle = FALSE
)

Arguments

data

A numeric vector of data to be fitted (e.g., annual maxima).

quant

The probabilities corresponding to high quantiles to be estimated. Default is c(0.98, 0.99, 0.995).

weight

The weighting method name. Options are:

  • 'like', 'like0', 'like1' (default): Likelihood-based weights (AIC)

  • 'gLd', 'gLd0', 'gLd1', 'gLd2': Generalized L-moment distance weights

  • 'med', 'med1', 'med2': Median-based weights

  • 'cvt': Conventional AIC weights

Variants with numbers indicate left trimming level (0, 1, or 2).

numk

The number of candidate submodels K. Default is 12.

B

The number of bootstrap samples. Default is 200.

varcom

Logical. Whether to compute variance of quantile estimates. Default is TRUE.

trim

The number of left trimming for L-moments. Usually 0 (default), 1, or 2.

fig

Logical. Whether to produce diagnostic plots. Default is FALSE.

bma

Logical. Whether to use Bayesian Model Averaging. Default is FALSE.

pen

Penalty type for BMA prior: 'norm' (normal, default) or 'beta'.

CD

Logical. Whether to compute Coles-Dixon penalized MLE. Default is FALSE.

remle

Logical. Whether to compute restricted MLE. Default is FALSE.

Details

The model averaging approach works as follows:

  1. MLE and LME of GEV parameters are computed

  2. K candidate shape parameters (xi) are selected from profile likelihood CI

  3. For each candidate xi, MLE with fixed xi is computed

  4. Weights are assigned based on the selected method

  5. Final quantile estimates are weighted averages across submodels

The weighting schemes include:

When bma=TRUE, Bayesian model averaging is applied with prior specified by pen.

Value

A list containing:

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y., & Park, J. S. (2026). Model averaging with mixed criteria for estimating high quantiles of extreme values: Application to heavy rainfall. Stochastic Environmental Research and Risk Assessment, 40(2), 47. doi:10.1007/s00477-025-03167-x

See Also

glme.gev for stationary GLME estimation, magev.ksensplot for K sensitivity analysis, magev.qqplot for Q-Q diagnostic plots, magev.rlplot for return level plots.

Examples

# Load example data
data(streamflow)
x <- streamflow$r1

# Basic usage with likelihood weights
result <- ma.gev(x, quant = c(0.95, 0.99), weight = 'like1', B = 100)
print(result$qua.ma)     # Model-averaged quantiles
print(result$qua.mle)    # MLE quantiles for comparison
print(result$qua.lme)    # LME quantiles for comparison

# Using generalized L-moment distance weights
result2 <- ma.gev(x, quant = c(0.95, 0.99), weight = 'gLd', B = 100)
print(result2$w.ma)      # Model weights


K Sensitivity Plot for MAGEV

Description

Plots return level estimates, standard errors, and first-order differences across different numbers of candidate submodels K. This helps identify stable regions where estimates converge and select an optimal K value.

Usage

magev.ksensplot(
  data = NULL,
  q.cut = 0.6,
  mink = 4,
  maxk = 20,
  quant = c(0.99, 0.995)
)

Arguments

data

A numeric vector of data to be fitted (e.g., annual maxima).

q.cut

Quantile cutoff for determining stability (default 0.6).

mink

Minimum number of candidate submodels to test (default 4).

maxk

Maximum number of candidate submodels to test (default 20).

quant

The probabilities for high quantile estimation. Default is c(0.99, 0.995).

Details

The function computes MAGEV estimates for K ranging from mink to maxk. For each K, it calculates:

The optimal K is selected as the smallest value where both the normalized standard error and first-order difference are below their respective q.cut quantile cutoffs. The selected K is indicated by a purple vertical line.

Value

The optimal K value (integer) selected by the algorithm.

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y., & Park, J. S. (2026). Model averaging with mixed criteria for estimating high quantiles of extreme values: Application to heavy rainfall. Stochastic Environmental Research and Risk Assessment, 40(2), 47. doi:10.1007/s00477-025-03167-x

See Also

ma.gev for the main model averaging function.

Examples


data(streamflow)
optimal_k <- magev.ksensplot(streamflow$r1)
print(optimal_k)



Q-Q Diagnostic Plot for MAGEV

Description

Creates a 2x2 panel of Q-Q plots comparing observed vs. fitted quantiles for different estimation methods: MLE, LME, surrogate (MA), and REMLE.

Usage

magev.qqplot(data = NULL, zx = NULL)

Arguments

data

A numeric vector of observed data.

zx

A list object returned by ma.gev with remle = TRUE.

Details

The function creates four Q-Q plots:

Points close to the 45-degree diagonal line indicate good model fit.

Value

NULL. The function produces a plot as a side effect.

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y., & Park, J. S. (2026). Model averaging with mixed criteria for estimating high quantiles of extreme values: Application to heavy rainfall. Stochastic Environmental Research and Risk Assessment, 40(2), 47. doi:10.1007/s00477-025-03167-x

See Also

ma.gev for the main model averaging function, magev.rlplot for return level plots.

Examples

data(streamflow)
qq <- c(seq(0.01, 0.99, by = 0.01), 0.995, 0.999)
zx <- ma.gev(streamflow$r1, quant = qq, weight = 'like1',
             numk = 9, varcom = FALSE, remle = TRUE)
magev.qqplot(data = streamflow$r1, zx = zx)


Return Level Plot for MAGEV

Description

Displays fitted return levels with 95 return period on a log scale.

Usage

magev.rlplot(par = NULL, se.vec = NULL, data = NULL)

Arguments

par

A numeric vector of GEV parameters (mu, sigma, xi) in Hosking style. Typically from zx$surr$par where zx is the output of ma.gev.

se.vec

A numeric vector of standard errors for the quantile estimates corresponding to the plotting positions. Typically from zx$ranw.se.ma.

data

A numeric vector of observed data (annual maxima).

Details

The plot shows:

The x-axis (return period) is on a log scale, ranging from 0.1 to 900 years.

Value

NULL. The function produces a plot as a side effect.

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y., & Park, J. S. (2026). Model averaging with mixed criteria for estimating high quantiles of extreme values: Application to heavy rainfall. Stochastic Environmental Research and Risk Assessment, 40(2), 47. doi:10.1007/s00477-025-03167-x

See Also

ma.gev for the main model averaging function, magev.qqplot for Q-Q diagnostic plots.

Examples

data(streamflow)
ff <- c(seq(0.01, 0.09, by = 0.01), 0.1, 0.2, 0.3, 0.4, 0.5,
        0.6, 0.7, 0.8, 0.9, 0.93, 0.95, 0.98, 0.99,
        0.993, 0.995, 0.998, 0.999)
zx <- ma.gev(streamflow$r1, quant = ff, weight = 'like1',
             numk = 9, varcom = TRUE)
magev.rlplot(par = zx$surr$par, se.vec = zx$ranw.se.ma, data = streamflow$r1)


Create maximum residual series for GEV11 model

Description

Internal function that constructs a modified residual series (qmax) from the data after removing estimated location trend, used for the GN16 time-varying moment method.

Usage

make.qmax.gev11(xdat = NULL, orig.para = NULL, rob = NULL)

Arguments

xdat

Numeric vector of data.

orig.para

Initial parameter vector (mu0, mu1, sigma0, sigma1, xi).

rob

Logical. If TRUE, use robust regression. If FALSE, use OLS.

Value

A list containing:

qmax

Modified residual series (numeric vector)

sig0

Log-scale intercept estimate

sig1

Log-scale trend estimate


Coles-Dixon Penalized MLE for GEV

Description

Computes maximum penalized likelihood estimates for GEV parameters using the Coles and Dixon (1999) prior penalty on the shape parameter.

Usage

mle.gev.CD(xdat, ntry = 10)

Arguments

xdat

Numeric vector of data.

ntry

Number of random starting points for optimization. Default is 10.

Value

A list containing:

mle

MLE estimates (mu, sigma, xi) in Hosking style

nllh

Negative log-likelihood at the optimum

conv

Convergence status (0 = success)

nsample

Sample size

References

Coles, S., & Dixon, M. (1999). Likelihood-based inference for extreme value models. Extremes, 2(1), 5-23.


Moving average smoother for quantiles and weights

Description

Internal function that applies moving average smoothing to quantile estimates and weights across candidate submodels.

Usage

movave(order, numk, numq, zp, wt = NULL)

Arguments

order

Order of the moving average.

numk

Number of candidate submodels.

numq

Number of quantile probabilities.

zp

Matrix (numq x numk) of quantile estimates.

wt

Numeric vector of weights (length numk).

Value

A list containing:

ez

Matrix (numq x numk) of smoothed quantile estimates

ew

Numeric vector of smoothed weights


Adaptively expand or prune candidate xi set

Description

Internal function that adaptively adjusts the candidate xi set by removing low-weight candidates and adding new candidates near boundary or dominant regions to improve weight coverage.

Usage

new.kpar2(
  wtgd = NULL,
  numk = NULL,
  kpar = NULL,
  remove = 0.004,
  dist = 0.02,
  tre1 = 0.01,
  tre8 = 0.5
)

Arguments

wtgd

Numeric vector of current weights.

numk

Number of candidate submodels.

kpar

Numeric vector of candidate xi values.

remove

Threshold below which candidates are removed. Default is 0.004.

dist

Spacing for new candidates. Default is 0.02.

tre1

Lower threshold for boundary detection. Default is 0.01.

tre8

Upper threshold for dominant candidate. Default is 0.5.

Value

A list containing:

kpar2

Updated candidate xi values

aw

Adjustment indicator (0 = no change needed)

numk

Updated number of candidates


GLME objective function for GEV11 model (mu0, sigma0, xi optimization)

Description

GLME objective function for GEV11 model (mu0, sigma0, xi optimization)

Usage

nllh.glme.gev11(
  a,
  xdat = xdat,
  newtheta = newtheta,
  covinv = covinv,
  lcovdet = lcovdet,
  pen = pen,
  mu = mu,
  std = std,
  p = p,
  c1 = c1,
  c2 = c2
)

Arguments

a

Parameter vector (mu0, sigma0, xi).

xdat

Data vector.

newtheta

Full parameter vector (mu0, mu1, sigma0, sigma1, xi).

covinv

Inverse covariance matrix.

lcovdet

Log determinant of covariance.

pen

Penalty type.

mu

Normal penalty mean.

std

Normal penalty std.

p

Beta penalty shape.

c1

Beta penalty scaling.

c2

Beta penalty limit.

Value

Negative log-likelihood value.

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park


Non-stationary GEV Parameter Estimation

Description

Estimates parameters of a non-stationary Generalized Extreme Value (GEV) distribution using the L-moment-based algorithm from Shin et al. (2025, J. Korean Stat. Soc.). This function combines L-moments, goodness-of-fit measures, and robust regression.

This is a convenience wrapper around glme.gev11 with pen="no", providing compatibility with the original nsgev package interface.

Usage

nsgev(xdat, ntry = 20, ftol = 1e-06)

Arguments

xdat

A numeric vector of data to be fitted (e.g., annual maximum values).

ntry

Number of attempts for optimization (default 20).

ftol

Function tolerance for optimization (default 1e-6).

Value

A list containing:

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y. & Park, J.-S. (2025). Building nonstationary extreme value model using L-moments. Journal of the Korean Statistical Society, 54, 947-970. doi:10.1007/s42952-025-00325-3

See Also

glme.gev11 for the full GLME method with penalty functions, gado.prop_11 for detailed estimation results.

Examples

data(Trehafod)
result <- nsgev(Trehafod$r1, ntry = 5)
print(result$para.prop)


L-moment distance function for GEV11 model

Description

Internal function that computes the L-moment distance vector for the GEV11 model. The residuals are formed from the difference between theoretical Gumbel L-moments and sample L-moments of standardized data.

Usage

obj.lme.gev11(a, xdat = xdat, pretheta = pretheta)

Arguments

a

Numeric vector (mu0, sigma0, xi) to optimize.

xdat

Numeric vector of data.

pretheta

Full parameter vector (mu0, mu1, sigma0, sigma1, xi) from pre-estimation.

Value

Numeric vector of length 3, representing L-moment equation residuals.


Multi-start optimization for GEV11 model

Description

Internal function that performs multi-start optimization for the non-stationary GEV11 model. First solves L-moment equations via nleqslv (Broyden method), then optionally refines with penalized optimization via optim. Selects the best solution using goodness-of-fit or penalized negative log-likelihood.

Usage

optim.glme.gev11(
  xdat,
  ntry = 10,
  ftol = 1e-06,
  pretheta = NULL,
  model = "gev11",
  pen = "beta",
  mu = mu,
  std = std,
  p = p,
  c1 = c1,
  c2 = c2,
  choose = NULL
)

Arguments

xdat

Numeric vector of data.

ntry

Number of random starting points. Default is 10.

ftol

Tolerance for convergence. Default is 1e-6.

pretheta

Pre-estimated parameter vector (mu0, mu1, sigma0, sigma1, xi).

model

Model type: "gev11" (default), "gev10", or "gev20".

pen

Penalty type: "beta" (default), "norm", "ms", "park", "cannon", "cd", or "no".

mu

Normal penalty mean.

std

Normal penalty standard deviation.

p

Beta penalty shape parameter.

c1

Beta penalty scaling parameter.

c2

Beta penalty limit parameter.

choose

Selection method: "gof" (goodness-of-fit) or "nllh".

Value

A list containing:

para.lme

L-moment based estimates (5 parameters)

precis

Precision of the best solution

para.glme

GLME estimates (if pen != "no")

nllh.glme

Penalized negative log-likelihood (if pen != "no")

pen

Penalty type used


GEV parameter estimation with fixed shape parameter

Description

Estimates GEV location and scale parameters from L-moments while keeping the shape parameter fixed at a user-specified value. Modified from lmomco::pargev().

Usage

pargev.kfix(lmom, kfix = 0.1, checklmom = TRUE, ...)

Arguments

lmom

L-moments object.

kfix

Fixed shape parameter value.

checklmom

Whether to check L-moment validity.

...

Additional arguments.

Value

A list with components:

type

Character "gev"

para

Numeric vector of GEV parameters (xi=location, alpha=scale, kappa=shape)

source

Character "pargev"

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Hosking, J. R. M. (1990). L-moments: Analysis and estimation of distributions using linear combinations of order statistics. Journal of the Royal Statistical Society, Series B, 52(1), 105-124. doi:10.1111/j.2517-6161.1990.tb01775.x

See Also

glme.gev for GLME estimation, pargev for the original L-moment GEV fitting.

Examples

data(streamflow)
lmom <- lmomco::lmoms(streamflow$r1, nmom = 3)
pargev.kfix(lmom, kfix = -0.1)


GEV parameter estimation with fixed shape parameter (MAGEV internal)

Description

Internal function that estimates GEV location and scale parameters given a fixed shape parameter, using L-moment equations.

Usage

pargev.xifix(lmom, xifix = 0.1, checklmom = TRUE, ...)

Arguments

lmom

L-moments object from lmomco::lmoms().

xifix

Fixed shape parameter value. Default is 0.1.

checklmom

Logical. Whether to check L-moment validity. Default is TRUE.

...

Additional arguments (unused).

Value

A list with components:

type

Character "gev"

para

Numeric vector of GEV parameters (mu, sigma, xi)

source

Character "pargev"


Beta preference function for non-stationary GEV

Description

Beta preference function for non-stationary GEV

Usage

pk.beta.ns(para = NULL, lme.center = NULL, p = NULL, c0 = 0.3, c1 = 10, c2 = 5)

Arguments

para

A vector of GEV parameters.

lme.center

L-moment estimates as center.

p

Shape parameter.

c0

Limit parameter (default 0.3).

c1

Scaling parameter (default 10).

c2

Upper limit parameter (default 5).

Value

A list containing pk.one, p, and q.

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park


Beta preference function for stationary GEV

Description

Computes a Beta distribution-based adaptive preference (penalty) function for the GEV shape parameter. The hyperparameters are adapted based on the L-moment estimate of the shape parameter.

Usage

pk.beta.stnary(
  para = NULL,
  lme.center = NULL,
  p = NULL,
  q = NULL,
  c0 = 0.3,
  c1 = 10,
  c2 = 5
)

Arguments

para

A vector of GEV parameters.

lme.center

L-moment estimates as center.

p

Shape parameter (default 6).

q

Shape parameter q (optional, if provided uses fixed limits).

c0

Limit parameter (default 0.3).

c1

Scaling parameter (default 10).

c2

Upper limit parameter (default 5).

Value

A list containing:

pk.one

Preference function value (scalar)

p

Shape parameter p used

q

Shape parameter q used

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y., Park, J. & Park, J.-S. (2025). Generalized method of L-moment estimation for stationary and nonstationary extreme value models. arXiv preprint arXiv:2512.20385. doi:10.48550/arXiv.2512.20385

See Also

pk.norm.stnary for the normal penalty, MS_pk for the Martins-Stedinger penalty, glme.gev which uses these penalty functions.

Examples

# Beta preference for xi = -0.2 centered at LME xi = -0.15
pk.beta.stnary(para = c(100, 20, -0.2),
               lme.center = c(100, 20, -0.15), p = 6)


Normal preference function for shape parameter (stationary GEV)

Description

Computes a normal distribution-based preference (penalty) function value for the GEV shape parameter. The alias new_pf_norm is provided for backward compatibility.

Usage

pk.norm.stnary(para = NULL, mu = NULL, std = NULL)

new_pf_norm(para = NULL, mu = NULL, std = NULL)

Arguments

para

A vector of GEV parameters.

mu

Mean for normal distribution.

std

Standard deviation for normal distribution.

Value

Preference function value (scalar).

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y., Park, J. & Park, J.-S. (2025). Generalized method of L-moment estimation for stationary and nonstationary extreme value models. arXiv preprint arXiv:2512.20385. doi:10.48550/arXiv.2512.20385

See Also

pk.beta.stnary for the beta penalty, MS_pk for the Martins-Stedinger penalty, glme.gev which uses these penalty functions.

Examples

# Normal preference with mean=-0.5, sd=0.2 at xi=-0.2
pk.norm.stnary(para = c(100, 20, -0.2), mu = -0.5, std = 0.2)


Beta prior for model averaging

Description

Internal function that computes a Beta distribution prior probability for a candidate shape parameter in model averaging.

Usage

prior.beta.stnary.ma(x = NULL, xi_lme = NULL, p = 2, q = 5, al, bl)

Arguments

x

Shape parameter value to evaluate.

xi_lme

L-moment estimate of xi (unused in this version).

p

Beta shape parameter p. Default is 2.

q

Beta shape parameter q. Default is 5.

al

Lower bound of support.

bl

Upper bound of support.

Value

Prior probability value (scalar).


Quantile function for GEV11 model

Description

Internal wrapper that computes time-varying quantiles for the GEV11 model given a return period.

Usage

qns.gev11(Tp = NULL, para = NULL, year = NULL)

Arguments

Tp

Return period.

para

Parameter vector (mu0, mu1, sigma0, sigma1, xi).

year

Time vector.

Value

Numeric vector of quantile values (one per time point).


Quantile function for non-stationary GEV (return period input)

Description

Internal function that computes time-varying quantiles for non-stationary GEV models given a return period.

Usage

qns.gev_all(Tp = NULL, para = NULL, year = NULL, model = NULL)

Arguments

Tp

Return period (scalar).

para

Parameter vector for the non-stationary model.

year

Numeric vector of time points.

model

Model type: "gev11", "gev10", "gev20", or "gev01".

Value

Numeric vector of quantile values (one per time point).


Quantile function for non-stationary GEV models

Description

Calculates quantiles for non-stationary GEV models including GEV11, GEV10, GEV20, and stationary GEV00.

Usage

quagev.NS(f = NULL, para = NULL, nsample = NULL, model = NULL)

Arguments

f

Probability (or vector of probabilities) for quantile calculation.

para

Parameter vector. For GEV11: (mu0, mu1, sigma0, sigma1, xi).

nsample

Number of time points (sample size).

model

Model type: "gev11", "gev10", "gev20", "gev01", or "gev00"/"gev".

Value

A matrix of quantiles (nsample x length(f)) or a vector if f is scalar.

Author(s)

Yonggwan Shin, Seokkap Ko, Jihong Park, Yire Shin, Jeong-Soo Park

References

Shin, Y., Shin, Y., Park, J. & Park, J.-S. (2025). Generalized method of L-moment estimation for stationary and nonstationary extreme value models. arXiv preprint arXiv:2512.20385. doi:10.48550/arXiv.2512.20385

See Also

glme.gev11 for non-stationary GEV estimation, glme.gev for stationary GEV estimation.

Examples

# GEV11 model: time-varying quantiles
para <- c(84.55, 1.03, 2.91, 0.009, -0.08)  # mu0, mu1, sigma0, sigma1, xi
q99 <- quagev.NS(f = 0.99, para = para, nsample = 53, model = "gev11")
print(q99)


Revised Coles-Dixon prior function

Description

Internal function that computes a revised Coles-Dixon prior probability for the shape parameter, used as a penalty in BMA.

Usage

rcd(xi)

Arguments

xi

Numeric vector of shape parameter values.

Value

Numeric vector of prior probability values.


Restricted MLE for GEV (Mixed Estimation)

Description

Computes restricted maximum likelihood estimates for GEV parameters with constraints on the mean or median matching the sample statistics.

Usage

remle.gev(
  xdat,
  ntry = 5,
  rest = "mean",
  quant = c(0.99, 0.995),
  trim = 0,
  CD.mle = NULL,
  mle = NULL,
  second = TRUE,
  w.mpse = FALSE
)

Arguments

xdat

Numeric vector of data.

ntry

Number of random starting points. Default is 5.

rest

Restriction type: 'mean' (default) or 'median'.

quant

Probabilities for quantile estimation. Default is c(0.99, 0.995).

trim

Left trimming level. Default is 0.

CD.mle

Coles-Dixon MLE (optional). If NULL, computed internally.

mle

Standard MLE (optional). If NULL, computed internally.

second

Logical. If TRUE, compute second-stage REMLE. Default is TRUE.

w.mpse

Logical. If TRUE, compute MPSE. Default is FALSE.

Value

A list containing:

remle1

First-stage REMLE estimates

qua.remle1

Quantiles from first-stage REMLE

remle2

Second-stage REMLE estimates (if second=TRUE)

qua.remle2

Quantiles from second-stage REMLE

rest.method

Restriction method used


Select best parameters based on goodness-of-fit

Description

Internal function that selects the best parameter estimate from multiple candidates using energy distance-based goodness-of-fit across multiple return periods.

Usage

sel.para_all(xdat, para.sel = NULL, model = NULL, obj.fun = NULL)

Arguments

xdat

Numeric vector of data.

para.sel

Matrix of candidate parameter sets (ntry x npar).

model

Model type: "gev11", "gev10", or "gev20".

obj.fun

Numeric vector of objective function values (tie-breaker).

Value

A list containing:

para

Best parameter vector

min.itry

Index of the best candidate

gof

Goodness-of-fit values for all candidates

obj.fun

Input objective function values


Set parameters based on non-stationary model type

Description

Internal function that maps a flat parameter vector to named location (mu), scale (sig), and shape (xi) components depending on the model specification (GEV00, GEV10, GEV11, GEV20, GEV01).

Usage

set.para.model(para, model = NULL)

Arguments

para

Parameter vector whose length and meaning depend on model.

model

Model type: "gev11", "gev10", "gev20", "gev01", or "gev00"/"gev".

Value

A list containing:

mu

Numeric vector c(mu0, mu1, mu2) for location

sig

Numeric vector c(sigma0, sigma1) for log-scale

xi

Shape parameter (scalar)


Set BMA prior distribution for candidate shape parameters

Description

Internal function that sets up the prior distribution for Bayesian Model Averaging (BMA) weights. Supports both normal and beta priors, with hyperparameters adapted based on the weighting method and L-moment estimate of xi.

Usage

set.prior(pen = NULL, numk = NULL, xi_lme = NULL, kpar = NULL, weight = NULL)

Arguments

pen

Prior type: "norm" (normal) or "beta".

numk

Number of candidate submodels.

xi_lme

L-moment estimate of the shape parameter.

kpar

Numeric vector of candidate xi values.

weight

Weighting method name ("like", "gLd", or "med").

Value

A list containing:

prior

Numeric vector of prior probabilities (length numk)

prior_mu_std

(if pen="norm") Mean and std of the normal prior

p_q_beta

(if pen="beta") p and q parameters of the beta prior


Streamflow Data

Description

Annual maximum streamflow measurements for extreme value analysis.

Usage

streamflow

Format

A data frame with 50 rows and 2 columns:

Year

Year of observation (character)

r1

Annual maximum streamflow value (numeric)

Source

UK National River Flow Archive, Peak Flow Dataset (https://nrfa.ceh.ac.uk/data/peak-flow-dataset).

References

Grego, J. M., Yates, P. A., & Mai, K. (2015). Standard error estimation for mixed flood distributions with historic maxima. Environmetrics, 26(3), 229-242. doi:10.1002/env.2333

Shin, Y., Shin, Y., & Park, J. S. (2025). Building nonstationary extreme value model using L-moments. Journal of the Korean Statistical Society, 1-24. doi:10.1007/s42952-025-00325-3

Examples

data(streamflow)
head(streamflow)


Strup WLS estimation for GEV11

Description

Internal function that performs weighted least squares (WLS) estimation for the non-stationary GEV11 model using the Strup method. Estimates location trend and log-scale parameters through iterative regression steps.

Usage

strup.glme.gev11(xdat, orig.para = NULL, rob = NULL)

Arguments

xdat

Numeric vector of data.

orig.para

Initial parameter vector (mu0, mu1, sigma0, sigma1, xi).

rob

Logical. If TRUE, use robust regression. If FALSE, use OLS.

Value

A list containing:

strup.sta

Stationary L-moment estimates of standardized residuals

strup.para

Raw Strup parameter estimates (5 parameters)

strup.final

Final adjusted parameter estimates (5 parameters)


Find surrogate GEV parameters for model-averaged quantiles

Description

Internal function that fits a single GEV distribution to the model-averaged quantile curve, producing surrogate GEV parameters that approximate the model-averaged quantile function.

Usage

surrogate(zpf.surr = NULL, xqa, init.surr)

Arguments

zpf.surr

Numeric vector of model-averaged quantiles at xqa.

xqa

Numeric vector of probabilities at which quantiles are evaluated.

init.surr

Initial GEV parameter estimates for optimization.

Value

A list (from optim()) with additional components:

par

Surrogate GEV parameters (mu, sigma, xi)

zp.surrmodel

Quantiles from the surrogate model at xqa

zp.MA

The input model-averaged quantiles


Time-varying moment estimation (GN16 method)

Description

Internal function that implements the GN16 time-varying moment method for non-stationary GEV11 estimation. Computes time-varying location from the shape parameter and scale function.

Usage

## S3 method for class 'm.gev11'
time(qmax = NULL, orig.para = NULL, rob = FALSE, mdfy = TRUE)

Arguments

qmax

Modified residual series from make.qmax.gev11().

orig.para

Initial parameter vector (mu0, mu1, sigma0, sigma1, xi).

rob

Logical. If TRUE, use robust regression. Default is FALSE.

mdfy

Logical. If TRUE, apply modified GN16 with updated alpha0. Default is TRUE.

Value

A list containing:

mu_t

Time-varying location values

para.org

Estimated parameters (mu0, mu1, sigma0, sigma1, xi)

mu_t.up

Updated time-varying location (if mdfy=TRUE)


Compute model averaging weights

Description

Internal function that computes weights for model averaging across K candidate GEV submodels. Supports multiple weighting schemes including likelihood-based, generalized L-moment distance, and median-based methods. Optionally includes BMA prior integration.

Usage

weight.com(
  data = NULL,
  numk = NULL,
  hosking = NULL,
  kpar = NULL,
  numom = 3,
  xqa = NULL,
  varcom = TRUE,
  boot.lme = TRUE,
  cov.lme = NULL,
  surr = FALSE,
  type = "full",
  trim = NULL,
  cov.type = "ratio",
  bma = TRUE,
  pen = "norm"
)

Arguments

data

Numeric vector of data.

numk

Number of candidate submodels.

hosking

List containing LME results, MLE, and bootstrap information.

kpar

Numeric vector of candidate xi values.

numom

Number of L-moments to use (default 3).

xqa

Probability vector for surrogate model fitting.

varcom

Logical. Whether to compute variance components (default TRUE).

boot.lme

Logical. Whether bootstrap LME was performed (default TRUE).

cov.lme

Pre-computed LME covariance (default NULL).

surr

Logical. Whether to compute surrogate quantiles (default FALSE).

type

Type of computation: "full" (default).

trim

Left trimming level for L-moments.

cov.type

Covariance type: "ratio" or "lambda" (default "ratio").

bma

Logical. Whether to compute BMA weights (default TRUE).

pen

BMA prior type: "norm" or "beta" (default "norm").

Value

A list containing:

weight

Weighting method name

numk

Number of submodels

wtgd

MA weight vector (length numk)

bmaw

BMA weight vector (length numk)

zp

Quantile matrix (numq x numk)

kpar

Candidate xi values

prob.call

Submodel fitting results

xzp

Surrogate quantile matrix (if surr=TRUE)


Likelihood-based weights with fixed xi

Description

Internal function that computes AIC-based model averaging weights using the profile likelihood with L-moment submodel estimates for each candidate xi.

Usage

wlik.xifix(
  data = NULL,
  numk = NULL,
  kpar = NULL,
  weight = NULL,
  pertr = 0.85,
  varcom = FALSE,
  type = NULL,
  prior = NULL,
  trim = NULL
)

Arguments

data

Numeric vector of data.

numk

Number of candidate submodels.

kpar

Numeric vector of candidate xi values.

weight

Weighting method name.

pertr

Perturbation parameter (default 0.85).

varcom

Logical. Whether to compute variance (default FALSE).

type

Type of computation.

prior

Numeric vector of BMA prior values.

trim

Left trimming level.

Value

A list containing:

bmaw

BMA weight vector

wt

MA weight vector

aic

AIC values for each submodel

kfix

Matrix (3 x numk) of submodel parameters

cov2

List of 2x2 covariance matrices (if varcom=TRUE)


Weighted least squares core estimation for GEV11

Description

Internal function that performs the core WLS steps: (Step 3) estimate log-scale trend from absolute residuals, (Step 4) estimate location trend from weighted data, (Step 5) compute standardized residuals.

Usage

wls.gev11(xdat, res = NULL, rob = NULL)

Arguments

xdat

Numeric vector of data.

res

Numeric vector of residuals from initial location regression.

rob

Logical. If TRUE, use robust regression. If FALSE, use OLS.

Value

A list containing:

sig

Log-scale regression coefficients c(sigma0, sigma1)

m

Location regression coefficients c(mu0, mu1)

res

Standardized residuals