Learn R Programming

tsDyn (version 11.0.4.1)

resample_vec: Resampling schemes

Description

Bootstrap a vector according to multiple resampling schemes: resampling, block resampling, Wild bootstrap.

Usage

resample_vec(
  x,
  boot.scheme = c("resample", "resample_block", "wild1", "wild2", "check"),
  seed = NULL,
  block.size = 2
)

Arguments

x

A numeric vector

boot.scheme

The type of resampling scheme used, see Details

seed

the seed used, see set.seed

block.size

for the resample_block scheme, the size of the blocks.

Details

This function offers various bootstrap/resampling schemes:

resample

Resampling with replacement

resample_block

Resampling contiguous observations (blocks) with replacement. Use argument block.size

wild1

Wild bootstrap: do not resample, but add a N(0,1) distribution to each value

wild12

Wild bootstrap: same, but add instead -1 or 1.