Description Usage Arguments Details Value
This function generates an index vector that can be used to subset an xts matrix in a rolling window random fashion. For speed, the underlying code uses Rcpp to generate the random vectors.
1 | roll_bootstrap(N, k = 3, nc = 1)
|
N |
The length of the vector we wish to generate |
k |
The rolling window width |
nc |
The number of columns to generate (number of vectors) |
The function is used to create synthetic time series by reordering the returns randomly in a rolling window fashion.
The implication is any autocorrelation between consecutive or near consecutive return samples will be randomly shuffled. However, the heteroscedastic properties of the series over longer time frames is mostly maintained.
Returns a numeric matrix of N rows by nc columns. Consider using apply to then apply these index to generate an equivalent xts matrix. See examples to understand how to do this.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.