maxbootr | R Documentation |
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
)
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.