| lmrd | R Documentation |
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.
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)
x |
Numeric vector of observations. For |
xlab |
Character: x-axis label used in plots. Defaults to
|
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 |
draw |
Logical: if |
thresholds |
Optional numeric vector of candidate threshold values.
If |
n_thresholds |
Integer: number of candidate threshold values to
evaluate when |
min_exceedances |
Integer: minimum number of exceedances required at
each threshold. Thresholds with fewer exceedances are excluded.
Default |
conf |
Numeric in |
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.
Both functions return a ggplot object invisibly and (by default)
display the plot.
Karuna G. Reddy karuna.reddy@auckland.ac.nz
M. G. M. Khan mgm.khan@usp.ac.fj
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.
fitverse with dists = "gpd" for formal GPD fitting
after threshold selection.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.