| Title: | Efficient Bootstrap Methods for Block Maxima |
|---|---|
| Description: | Implements state-of-the-art block bootstrap methods for extreme value statistics based on block maxima. Includes disjoint blocks, sliding blocks, relying on a circular transformation of blocks. Fast C++ backends (via 'Rcpp') ensure scalability for large time series. |
| Authors: | Torben Staud [aut, cre, cph] |
| Maintainer: | Torben Staud <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.0 |
| Built: | 2026-05-17 07:45:03 UTC |
| Source: | https://github.com/torbenstaud/maxbootr |
Extracts block maxima from a univariate numeric vector or matrix using disjoint, sliding, or circular (k-dependent) block schemes.
blockmax(xx, block_size, type = "sb", k = 2)blockmax(xx, block_size, type = "sb", k = 2)
xx |
A numeric vector or matrix. For matrix input, each row is treated as a separate univariate series. |
block_size |
Positive integer. Size of each block for maxima extraction. |
type |
Character. Type of block maxima to compute. One of: |
k |
Integer (only used if |
A numeric vector (if xx is a vector) or a matrix (if xx is a matrix). Each entry contains block maxima computed according to the selected method.
if (requireNamespace("maxbootR", quietly = TRUE)) { set.seed(42) x <- rnorm(100) # Disjoint blocks of size 10 bm_db <- blockmax(xx = x, block_size = 10, type = "db") # Sliding blocks of size 10 bm_sb <- blockmax(xx = x, block_size = 10, type = "sb") # Circular blocks of size 10 with blocking parameter k = 2 bm_cb <- blockmax(xx = x, block_size = 10, type = "cb", k = 2) }if (requireNamespace("maxbootR", quietly = TRUE)) { set.seed(42) x <- rnorm(100) # Disjoint blocks of size 10 bm_db <- blockmax(xx = x, block_size = 10, type = "db") # Sliding blocks of size 10 bm_sb <- blockmax(xx = x, block_size = 10, type = "sb") # Circular blocks of size 10 with blocking parameter k = 2 bm_cb <- blockmax(xx = x, block_size = 10, type = "cb", k = 2) }
A tibble containing daily negative log returns of closing prices for the S&P 500 stock market index. The observation period spans 20 trading years: 1995-01-01 to 2024-12-31.
data(logret_data)data(logret_data)
A tibble with 7,550 rows and 2 columns:
Date of observation (class Date)
Negative log return (numeric)
The data was obtained using the quantmod package with Yahoo Finance as the source.
Performs bootstrap resampling for various block maxima estimators (mean, variance, GEV parameters, quantile, return level) using either disjoint or sliding block methods.
maxbootr( xx, est, block_size, B = 1000, type = "sb", seed = 1, p = NULL, annuity = NULL )maxbootr( xx, est, block_size, B = 1000, type = "sb", seed = 1, p = NULL, annuity = NULL )
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 |
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: |
seed |
Integer. Seed for reproducibility. |
p |
Optional numeric value in (0,1). Required if |
annuity |
Optional numeric value > 1. Required if |
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).
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) }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) }
This dataset contains daily temperature measurements in °C from the Hohenpeißenberg weather station in Germany, covering 145 years: 1878-01-01 to 2023-12-31.
data(temp_data)data(temp_data)
A tibble with 52,960 rows and 2 columns:
Date of observation (class Date)
Temperature measured in °C (numeric)
The data was obtained from the Open Data Server of the German Meteorological Service (Deutscher Wetterdienst, DWD): https://opendata.dwd.de/ and thus, is protected by law. It is reused under the Creative Commons license CC BY 4.0.