lmrd: L-Moment Ratio Diagram and Extreme-Value Threshold Selection

View source: R/lmrd.R

lmrdR Documentation

L-Moment Ratio Diagram and Extreme-Value Threshold Selection

Description

Two diagnostic tools for exploratory data analysis in FitVerse.

lmrd() produces an L-moment ratio diagram plotting the sample (\tau_3, \tau_4) pair against the theoretical curves of major distribution families (GLO, GEV, GNO, PE3, GPA) and their known special cases (Normal, Logistic, Gumbel, Exponential, Uniform). The diagram guides distributional identification before formal model fitting.

ev_threshold() plots three threshold-stability diagnostics for Peaks-Over-Threshold (POT) extreme-value analysis: the Mean Residual Life (MRL) plot, the shape-stability plot, and the modified-scale-stability plot. These are used to identify the lowest threshold above which the Generalised Pareto Distribution (GPD) is a valid model for exceedances.

Usage

lmrd(x = NULL,
     xlab = NULL,
     distributions = c("glo", "gev", "gno", "pe3", "gpa"),
     show_ref_points = TRUE,
     draw = TRUE)

ev_threshold(x,
             thresholds      = NULL,
             n_thresholds    = 40L,
             min_exceedances = 10L,
             conf            = 0.95,
             xlab            = "x",
             draw            = TRUE)

Arguments

x

Numeric vector of observations. For lmrd, may be NULL to produce a blank reference diagram.

xlab

Character: x-axis label used in plots. Defaults to NULL (auto-labelled) for lmrd and "x" for ev_threshold.

distributions

Character vector: distribution families whose theoretical L-moment ratio curves are drawn. Default covers GLO, GEV, GNO, PE3, and GPA.

show_ref_points

Logical: whether to plot the known special-case reference points (Normal, Logistic, Gumbel, Exponential, Uniform). Default TRUE.

draw

Logical: if TRUE (default) the plot is printed; otherwise the ggplot object is returned invisibly.

thresholds

Optional numeric vector of candidate threshold values. If NULL (default), thresholds are chosen automatically.

n_thresholds

Integer: number of candidate threshold values to evaluate when thresholds = NULL. Default 40.

min_exceedances

Integer: minimum number of exceedances required at each threshold. Thresholds with fewer exceedances are excluded. Default 10.

conf

Numeric in (0, 1): confidence level for the pointwise confidence bands. Default 0.95.

Details

lmrd() computes the sample L-skewness \hat\tau_3 and L-kurtosis \hat\tau_4 via lmoms and plots the sample point against the theoretical loci for the GLO, GEV, GPA, GNO, and PE3 families. Exact closed-form curves are used for GLO, GEV, and GPA (Hosking, 1990); polynomial approximations are used for GNO and PE3 (Hosking and Wallis, 1997).

ev_threshold() fits a GPD to exceedances at each candidate threshold u and extracts the estimated shape \hat\xi and modified scale \hat\sigma^* = \hat\sigma - \hat\xi u. A stable region in both plots, combined with approximate linearity of the MRL plot, indicates a suitable threshold.

Value

Both functions return a ggplot object invisibly and (by default) display the plot.

Author(s)

Karuna G. Reddy karuna.reddy@auckland.ac.nz
M. G. M. Khan mgm.khan@usp.ac.fj

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 B, 52(1), 105–124. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.2517-6161.1990.tb01775.x")}

Hosking, J. R. M. and Wallis, J. R. (1997). Regional Frequency Analysis: An Approach Based on L-Moments. Cambridge University Press.

Davison, A. C. and Smith, R. L. (1990). Models for exceedances over high thresholds. Journal of the Royal Statistical Society B, 52(3), 393–442.

See Also

fitverse with dists = "gpd" for formal GPD fitting after threshold selection.

Examples


set.seed(42)
x <- rgamma(300, shape = 2, rate = 0.5)
lmrd(x, xlab = "Simulated Gamma data")



set.seed(1)
x_ev <- rexp(500, rate = 0.1)
ev_threshold(x_ev, n_thresholds = 30, xlab = "Simulated exponential")


FitVerse documentation built on Dec. 1, 2026, 1:07 a.m.