Skip to contents

Adaptation of Varty et al.'s metric-based threshold automated diagnostic for the independent and identically distributed case with no rounding.

Usage

thselect.vmetric(
  xdat,
  thresh,
  B = 199L,
  type = c("eqd", "exp", "qq", "pp"),
  dist = c("l1", "l2"),
  uq = FALSE,
  neval = 1000L,
  ci = 0.95
)

Arguments

xdat

vector of observations

thresh

vector of thresholds

B

number of bootstrap replications

type

string indicating scale, either exp for exponential quantile-quantile plot as in Varty et al. (2021) or pp for probability-probability plot (uniform). The method qq or expected quantile discrepancy (eqd) corresponds to Murphy et al. (2024) with the quantiles on the generalized Pareto scale.

dist

string indicating norm, either l1 for absolute error or l2 for quadratic error

uq

logical; if TRUE, generate bootstrap samples accounting for the sampling distribution of parameters

neval

number of points at which to estimate the metric. Default to 1000L

ci

level of symmetric confidence interval. Default to 0.95

Value

an invisible list with components

  • thresh: scalar threshold minimizing criterion

  • thresh0: vector of candidate thresholds

  • metric: value of the metric criterion evaluated at each threshold

  • type: argument type

  • dist: argument dist

Details

The algorithm proceeds by first computing the maximum likelihood algorithm and then simulating datasets from replication with parameters drawn from a bivariate normal approximation to the maximum likelihood estimator distribution.

For each bootstrap sample, we refit the model and convert the quantiles to exponential or uniform variates. The mean absolute or mean squared distance is calculated on these. The threshold returned is the one with the lowest value of the metric.

References

Varty, Z. and J.A. Tawn and P.M. Atkinson and S. Bierman (2021+), Inference for extreme earthquake magnitudes accounting for a time-varying measurement process.

Murphy, C., Tawn, J. A., & Varty, Z. (2024). Automated Threshold Selection and Associated Inference Uncertainty for Univariate Extremes. Technometrics, 67(2), 215–224. <doi:10.1080/00401706.2024.2421744>

Examples

xdat <- rexp(1000, rate = 1/2)
thresh <- quantile(xdat, prob = c(0.25,0.5, 0.75))