Skip to contents

Resamples blocks of consecutive observations. Delegates to boot::tsboot when boot is installed (fixed and stationary / geometric blocks); a circular-block path is implemented inline because boot::tsboot does not expose a circular-block sim mode directly. Falls back to a pure-R loop otherwise.

Usage

block_bootstrap(
  data,
  statistic,
  block_size,
  n_boot = 2000L,
  ci_level = 0.95,
  method = "circular",
  seed = 42L
)

Arguments

data

Numeric vector or matrix.

statistic

Function returning a scalar.

block_size

Integer block length.

n_boot

Number of replicates.

ci_level

Confidence level.

method

One of "moving", "circular", "stationary".

seed

Random seed.

Value

A morie_bootstrap_result.

See also