Skip to contents

Non-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). NULL or 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).

Value

A data.frame with columns: return_period, return_level, lower, upper, n_success, method.

Details

For each bootstrap replicate:

  1. Resample observations (iid or block bootstrap)

  2. Compute the threshold as the threshold_quantile of the resample

  3. Fit GPD via mev::fit.gpd() to exceedances

  4. Compute 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.