This repository contains pointers to the functions used in Belzile and Davison (2026+).
The datasets used in the applications can be obtained from the R package mev (version 2.2 and above) under cheeseborowind, abisko and thames, and can be loaded via the commands
data(thames, package = "mev")
data(cheeseborowind, package = "mev")
data(abisko, package = "mev")
Functions from package mev that are used in the paper include notably:
-
rmar1simulates series from a first-order max-autoregressive process with non-negative shape parameter. -
build.blockstakes a time series, calculates maxima ofblockconsecutive observations and builds a matrix with blocks of sizem, ordered by row. -
test.blocksizeimplements the likelihood ratio tests. -
qqplot.blocksizegenerates uniform quantile-quantile plots for the maximum, set of block maxima or the range with pointwise and simultaneous binomial-based confidence intervals for the positions, obtained using a parametric bootstrap. -
fit.gevblockreturns maximum likelihood estimates for the model with potential interval-censoring and left-censoring, also using the marginal likelihood of the$m-1$ lower order statistics.
The script helpers.R contains functions for the power study, including
-
rdistmaxfor simulating from the maximum ofmobservations from a parametric distributiondist. -
sim_altfor simulating data from a GEV where the largest observation of a block of size$m$ is drawn from a different distribution. -
sim_alt_mdafor simulating data from the maximum ofmobservations from a parametric distribution, mimickingsim_alt. -
simu_fnfor running the simulation study for independent data drawn from a GEV -
simu_fn_mdafor running the simulation study with independent data drawn from the max domain of attraction. -
simu_fn_stfor running the simulation study with first-order max-autoregressive data with GEV margins. -
autoplot.mev_plot_blockfor generatingggplot2graphs for the probability-probability plots, as generated byqqplot.blocksize. -
gev.loglik.censfor the log-likelihood of left-censored and interval-censored GEV data -
gev.prof.probfor the profile log likelihood based ongev.loglik.cens, parametrized in terms of probability of exceedance.
Several scripts for generating the results presented in the paper, including
-
tests-coverage.Rfor the coverage of simultaneous binomial confidence intervals for probability-probability plots. -
tests-marginal-efficiency.Rfor calculation of the relative efficiency of the marginal likelihood of the$m-1$ smallest order statistics out of$m$ . -
tests-marginal-likelihood.Rfor calculating the sampling distribution of the MLE for the data with full likelihood, marginal likelihood, and marginal likelihood together with additional support constraints.
For power studies, we use the simsalapar package and the following scripts
power-study-1-GEV.Rfor the independent and identically distributed case;power-study-2-MDA.Rfor max domain of attraction case (with Gumbel and normal);power-study-3-MAR.Rfor max-autoregressive processes;power-study-4-MAR.Rfor block maxima of max-autoregressive processes;power-study-5-GEV.Rfor rounded and left-censored data.
and the output tables
table-size-gev.Rfor the error rate of tests frompower-study-1-GEV.Rtable-size-mda.Rfor the error rate of tests frompower-study-2-MDA.R
Code for reproducing the data applications can be found in
application-Cheeseboro.Rfor the wind gust semicentennial maximum in Cheeseboro, California, USA.application-Thames.Rfor the river flow at Kingston, UK.application-Abisko.Rfor the probability of landslide-triggering rainfall episodes in Abisko, Sweden.
Code for reproducing additional figures can be found in
-
plot-penultimate.Rfor the penultimate parameters of Gaussian and Weibull, along with their max-stable extrapolation. -
plot-penultimate-density.Rfor the GEV and true density for$m=30$ and$m=300$ . -
plot-MAR.Rfor the first-order max-autoregressive simulation and comparison of location parameters relative to independent data. -
plot-GEV-efficiency.Rfor the efficiency ratios for GEV data. -
plot-power-study-1.R,plot-power-study-5.Rto produce plots in Figures 3 and A6