Description Usage Arguments Details Value Methods (by class) References See Also
Generate R
bootstrap replicates for time series.
The replicate time series can be generated using either fixed or random
block lengths.
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), ...)
|
data |
A data frame |
... |
Arguments passed to methods |
R |
Number of bootstrap replicates |
size |
If sim is |
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 |
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
.
A data frame with R
rows and the following columns:
A list of resample
objects. Training sets.
A list of resample
objects. Test sets.
An integer vector of identifiers
data.frame
: Generate time series replicates using blocks of
rows in the data frame.
grouped_df
: Generate time series replicates using blocks of
groups in the grouped data frame.
Kunsch, H.R. (1989) The jackknife and the bootstrap for general stationary observations. Annals of Statistics
Davison, A.C. and Hinkley, D.V. (1997) Bootstrap Methods and Their Application. Cambridge University Press.
Politis, D.N. and Romano, J.P. (1994) "The stationary bootstrap. Journal of the American Statistical Association."
Angelo Canty and Brian Ripley (2016). boot: Bootstrap R (S-Plus) Functions. R package version 1.3-18.
The boot function tsboot
, from which this
function is derived.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.