Calculates sufficient statistics for the K-gaps model for the extremal index
kgaps_stats(data, thresh, k = 1, inc_cens = FALSE)
A numeric vector of raw data. No missing values are allowed.
A numeric scalar. Extreme value threshold applied to data.
A numeric scalar. Run parameter k
units are assigned to the same cluster, resulting in a
A logical scalar indicating whether or not to include contributions from censored inter-exceedance times relating to the first and last observation. See Attalides (2015) for details.
A list containing the sufficient statistics, with components
N0
: the number of zero K-gaps
N1
: contribution from non-zero K-gaps (see
Details)
sum_qs
: the sum of the (scaled) K-gaps, i.e.
The sample K-gaps are
Suveges, M. and Davison, A. C. (2010) Model misspecification in peaks over threshold analysis, The Annals of Applied Statistics, 4(1), 203-221. https://doi.org/10.1214/09-AOAS292
Attalides, N. (2015) Threshold-based extreme value modelling, PhD thesis, University College London.
kgaps_mle
for maximum likelihood estimation of the
extremal index
# NOT RUN {
u <- quantile(newlyn, probs = 0.90)
kgaps_stats(newlyn, u)
# }
Run the code above in your browser using DataLab