Learn R Programming

mev (version 2.1)

qweissman: Weissman's quantile estimator

Description

Given a small probability of exceedance p, the number of exceedances k out of n observation above the threshold \(u\) (thresh) (corresponding typically to the (\(k+1\))th order statistic, compute the tail quantile at level \(Q(1-p)\) using the estimator of Weissman (1978) under the assumption of Pareto tail (positive shape \(\xi\)), viz. $$ Q(1-p) = u \left(\frac{k}{pn}\right)^{\xi}.$$

Usage

qweissman(p, k, n, thresh, shape)

Value

a vector of tail quantiles

Arguments

p

tail probability, must be larger than the proportion of exceedances k/n.

k

vector of the number of exceedances above thresh

n

integer, total sample size

thresh

vector of thresholds

shape

vector of positive shape parameters

References

Weissman, I. (1978). Estimation of Parameters and Larger Quantiles Based on the k Largest Observations. Journal of the American Statistical Association, 73(364), 812–815. <doi:10.2307/2286285>.

Examples

Run this code
set.seed(2025)
p <- 1/100
xdat <- rgp(n = 1000, loc = 2, scale = 2, shape = 0.4)
hill <- shape.hill(xdat, k = seq(20L, 100L, by = 10L))
thresh <- sort(xdat, decreasing = TRUE)[hill$k+1]
qweissman(
   p = 1/100,
   k = hill$k,
   n = length(xdat),
   thresh = thresh,
   shape = hill$shape)
# Compare with true quantile
qgp(1/100, loc = 2, scale = 2, shape = 0.4, lower.tail = FALSE)

Run the code above in your browser using DataLab