bootstrap_ts: Generate time-series bootstrap replicates

Description Usage Arguments Details References See Also

View source: R/bootstrap_ts.R

Description

Generate bootstrap replicates for time series items. The replicate time series can be generated using either fixed or random block lengths.

Usage

1
2
bootstrap_ts(n, times = 1L, block_size = 1L, size = n, type = c("fixed",
  "geom"), endcorr = TRUE)

Arguments

n

The number of observations.

times

The number of bootstrap samples.

block_size

If type = "fixed", then size is the fixed block length used in generating the bootstrap samples. If type = "geom" then size is the mean of the geometric distribution from which the block lengths were sample. The value of size must be a positive integer less than n.

size

A scalar integer representing the number of items in the output samples.

type

The type of simulation used to generate the replicate time series. The possible input values are "fixed", for block resampling with fixed block lengths of size, and "geom", for block resampling with block lengths having a geometric distribution with mean size).

endcorr

A scalar logical indicating whether to adjust for end correlations in blocks.

Details

If type = "fixed" then each replicate time series is found by taking blocks of length block_size, from the original time series and putting them end-to-end until a new series of length size is created. When type = "geom", a similar approach is taken except that the block lengths are sampled from a geometric distribution with mean block_size.

References

See Also

The boot function boot::tsboot(), from which this function is derived.


jrnold/ramsleep documentation built on May 29, 2019, 11:43 a.m.