GetBlocks {boodd}R Documentation

Compute Block Splitting for Atomic Markov Chains

Description

Computes regenerative blocks for atomic Markov chains.

Usage

GetBlocks(X, atom, m = min(X), M = max(X), func = sum, ...)

Arguments

X

A numeric vector representing a Markov chain.

atom

A numeric value; an atom of the Markov chain.

m

A numeric value; the lower truncation threshold Default is the 5th percentile of X.

M

A numeric value; the upper truncation threshold Default is the 95th percentile of X.

func

A function to apply to each block. Default is sum.

...

Additional arguments passed to the function func.

Details

Identifies values in X equal to atom to determines regeneration times and creates regeneration blocks (or cycles). The function then assigns block numbers, counts observations in each block, and calculates various statistics for each block.

Value

Returns a list containing:

  1. A data frame with the following columns:

    • Time - the index of each observation,

    • X - values of the process,

    • Bnumber - block number assigned to each observation,

    • regen - indicator (1 or 0) of regeneration times. 1 corresponds to the regeneration time.

  2. A matrix summarizing block characteristics with the following columns:

    • Block number - the block index,

    • Block length - number of observations in the block,

    • Truncated sum - the value of func applied to truncated observations in the block,

    • Valid points - number of observations within the truncation thresholds,

    • Winsorized value - the Winsorized value of func applied to the block,

    • Start index - the starting index of the block,

    • End index - the ending index of the block.

  3. Total blocks - the total number of regeneration blocks.

References

Bertail, P. and Dudek, A. (2025). Bootstrap for Dependent Data, with an R package (by Bernard Desgraupes and Karolina Marek) - submitted.

See Also

findBestEpsilon, ftrunc, regenboot, smallEnsemble.

Examples

X = genMM1(1000, 1, 2)
blocks = GetBlocks(X, 0, func=sum) # compute sum over all blocks (without truncation)
# compute sum over all blocks (with truncation over quantiles of order 5% and 95%)
blocks = GetBlocks(X, 0, func=sum,m=quantile(X,0.05),M=quantile(X,0.95)) 


[Package boodd version 0.1 Index]