Description Usage Arguments Details References See Also
Generate bootstrap replicates for time series items. The replicate time series can be generated using either fixed or random block lengths.
1 2 | bootstrap_ts(n, times = 1L, block_size = 1L, size = n, type = c("fixed",
"geom"), endcorr = TRUE)
|
n |
The number of observations. |
times |
The number of bootstrap samples. |
block_size |
If |
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 |
endcorr |
A scalar logical indicating whether to adjust for end correlations in blocks. |
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
.
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 boot::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.