Skip to contents

Performs bootstrap resampling for various block maxima estimators (mean, variance, GEV parameters, quantile, return level) using either disjoint or sliding block methods.

Usage

maxbootr(
  xx,
  est,
  block_size,
  B = 1000,
  type = "sb",
  seed = 1,
  p = NULL,
  annuity = NULL
)

Arguments

xx

A numeric vector or array containing univariate samples. For multivariate cases, samples should be arranged in rows.

est

A string specifying the estimator to apply. Must be one of "mean", "var", "gev", "quantile", or "rl".

block_size

Integer. Size of each block used in the block maxima extraction.

B

Integer. Number of bootstrap replicates to generate.

type

Type of block bootstrapping: "db" for disjoint blocks or "sb" for sliding blocks (internally approximated via circular blocks).

seed

Integer. Seed for reproducibility.

p

Optional numeric value in (0,1). Required if est = "quantile".

annuity

Optional numeric value > 1. Required if est = "rl" for return level estimation.

Value

A numeric vector with B rows for scalar estimators. If est = "gev", a matrix with B rows is returned. Each row contains 3 estimated GEV parameters (location, scale, shape).

Examples

if (requireNamespace("maxbootR", quietly = TRUE)) {
  library(maxbootR)
  set.seed(123)
  x <- rnorm(100)

  # Bootstrap mean using sliding blocks
  boot_mean <- maxbootr(x, est = "mean", block_size = 10, B = 20, type = "sb")

  # Bootstrap variance using disjoint blocks
  boot_var <- maxbootr(x, est = "var", block_size = 10, B = 20, type = "db")

  # Bootstrap 95%-quantile of block maxima using sliding blocks
  boot_q <- maxbootr(x, est = "quantile", block_size = 10, B = 20, type = "db", p = 0.95)
}