tsbootstrap: Generate time-series bootstrap replicates

Description Usage Arguments Details Value Methods (by class) References See Also

Description

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

Usage

1
2
3
4
5
6
7
8
9
tsbootstrap(data, ...)

## S3 method for class 'data.frame'
tsbootstrap(data, R = 1L, size = 1L, m = nrow(data),
  type = "fixed", ...)

## S3 method for class 'grouped_df'
tsbootstrap(data, R = 1L, size = 1L, type = "fixed",
  m = dplyr::n_groups(data), ...)

Arguments

data

A data frame

...

Arguments passed to methods

R

Number of bootstrap replicates

size

If sim is "fixed" then size is the fixed block length used in generating the replicate time series. If sim is "geom" then size is the mean of the geometric distribution used to generate the block lengths. size should be a positive integer less than the number of rows (data.frame) or groups grouped_df in data.

m

Lengths of time-series replicates

type

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

Details

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

Value

A data frame with R rows and the following columns:

train

A list of resample objects. Training sets.

test

A list of resample objects. Test sets.

.id

An integer vector of identifiers

Methods (by class)

References

See Also

The boot function tsboot, from which this function is derived.


jrnold/resamplr documentation built on May 20, 2019, 1:05 a.m.