Description Usage Arguments Details Value Note Author(s) References Examples
Generate R bootstrap replicates of a statistic applied to a time series. The replicate time series can be generated using fixed lengths replicates.
1 2 3 4 |
tseries |
A univariate or multivariate time series. |
statistic |
A function which when applied to
|
R |
A positive integer giving the number of bootstrap replicates required. |
l |
|
n.sim |
The length of the simulated series. |
ran.gen |
This is a function of three arguments. The first
argument is a time series, it is the result of selecting
|
ran.args |
This will be supplied to |
allow.parallel |
Logical TRUE/FALSE indicating
whether parallel computation via the foreach package
should be used. The default value is TRUE. OBS:paralllel
backend must be registered prior to calling
|
seed |
The used seed in the bootstrap replication. |
packages |
If |
export |
If |
... |
Extra argumetns to |
seed |
Numeric, the seed to |
This is a modified version of the
tsboot
of the boot package.
Here, only Moving Block Bootstrap is implemented,
the function is modified to return the resampled blocks
and some unecessary arguments were deleted. Additionaly,
the parallel
option is through
the doParallel package.
An object of class "boot" with similar components
as tsboot
For bugs and further requests please refer to https://github.com/matheusbarroso/dboot
Matheus de Vasconcellos Barroso, matheus.vb@gmail.com
Angelo Canty and Brian Ripley (2017). boot: Bootstrap R (S-Plus) Functions. R package version 1.3-19.
Davison, A. C. & Hinkley, D. V. (1997) Bootstrap Methods and Their Applications. Cambridge University Press, Cambridge. ISBN 0-521-57391-2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
library(dboot)
library(gamlss)
library(doParallel)
no_cores <- if(detectCores()==1) 1 else detectCores() -1
registerDoParallel(no_cores)
bootf <- function (db,ord,fam) {
fit2 <- garmaFit2(yt~x-1,data=db,order=ord,family=fam,tail=0,control=list(iter.max=1000))
return(fit2$coef)}
ord <- c(1,1) ; fam="GA"
db <- example_LFL
tsboot2(db, statistic=bootf, R = 10, l = 100,ord=ord,fam=fam,export=c("garmaFit2"),package=c("gamlss"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.