blockmax {maxbootR} | R Documentation |
Compute Block Maxima from a Time Series
Description
Extracts block maxima from a univariate numeric vector or matrix using disjoint, sliding, or circular (k-dependent) block schemes.
Usage
blockmax(xx, block_size, type = "sb", k = 2)
Arguments
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 |
Value
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.
Examples
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)
}