Bootstrap Confidence Intervals for GPD Return Levels
ci_bootstrap_return_levels.RdNon-parametric bootstrap (optionally block bootstrap) confidence intervals for GPD-based return levels. Resamples the raw data, refits the GPD, and computes return levels for each replicate.
Usage
ci_bootstrap_return_levels(
data,
variable,
return_periods = c(1, 5, 10),
n_boot = 500,
conf_level = 0.95,
block_size = NULL,
threshold_quantile = 0.95,
n_obs_per_year = 8760,
seed = 42
)Arguments
- data
Data frame containing the variable to analyse.
- variable
Character name of the column (e.g.
"wave_height").- return_periods
Numeric vector of return periods in years (default
c(1, 5, 10)).- n_boot
Number of bootstrap replicates (default 500).
- conf_level
Confidence level (default 0.95).
- block_size
Integer block size for block bootstrap (observations, not hours).
NULLor 0 for iid bootstrap. Use 48 for hourly data (2-day blocks) to preserve temporal dependence.- threshold_quantile
Quantile for the POT threshold (default 0.95).
- n_obs_per_year
Observations per year for return level calculation (default 8760 for hourly).
- seed
Random seed for reproducibility (default 42).
Details
For each bootstrap replicate:
Resample observations (iid or block bootstrap)
Compute the threshold as the
threshold_quantileof the resampleFit GPD via
mev::fit.gpd()to exceedancesCompute return levels via
calculate_gpd_return_levels()
The percentile method is used: CIs are the alpha/2 and 1-alpha/2
quantiles of the bootstrap distribution of return levels.