Performs the information matrix test (IMT) of Suveges and Davison (2010) to diagnose misspecification of the \(K\)-gaps model
kgaps_imt(data, u, k = 1)A numeric vector of raw data. No missing values are allowed.
Numeric vectors.  u is a vector of
extreme value thresholds applied to data.  k is a vector of values
of the run parameter \(K\), as defined in Suveges and Davison (2010).
See kgaps for more details.
An object (a list) of class c("kgaps_imt", "exdex")
  containing
A length(u) by length(k) numeric matrix.
    Column i contains, for K = k[i], the values of the
    information matrix test statistic for the set of thresholds in
    u.  The column names are the values in codek.
    The row names are the approximate empirical percentage quantile levels
    of the thresholds in u.
A length(u) by length(k) numeric matrix
    containing the corresponding \(p\)-values for the test.
A length(u) by length(k) numeric matrix
    containing the corresponding estimates of \(\theta\).
The input u and k.
The IMT is performed a over grid of all
  combinations of threshold and \(K\) in the vectors u
  and k.  If the estimate of \(\theta\) is 0 then the
  IMT statistic, and its associated \(p\)-value will be NA.
For details of the IMT see Suveges and Davison
  (2010).  There are some typing errors on pages 18-19 that have been
  corrected in producing the code: the penultimate term inside {...}
  in the middle equation on page 18 should be \((c_j(K))^2\), as should
  the penultimate term in the first equation on page 19; the {...}
  bracket should be squared in the 4th equation on page 19; the factor
  \(n\) should be \(N-1\) in the final equation on page 19.
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
kgaps for maximum likelihood estimation of the
  extremal index \(\theta\) using the \(K\)-gaps model.
# NOT RUN {
u <- quantile(newlyn, probs = seq(0.1, 0.9, by = 0.1))
imt <- kgaps_imt(newlyn, u, k = 1:5)
# }
Run the code above in your browser using DataLab