Description Usage Arguments Details Value Note Author(s) References Examples
This functions performs the data-based algorithm of Lahiri, Furukawa and Lee (2005), henceforth LFL, for the selection of optimal block length sizes in the case of block bootstrap of Kunsch (1989).
1 2 3 4 |
data |
A univariate or multivariate time series. It might be vector, matrix or data frame to be passed to statistic. |
statistic |
A function which when applied to data returns a vector containing the statistic of interest. Each time statistic is called it is passed a time series of length n which is of the same class as the original tseries. Any other arguments which statistic takes must remain constant for each bootstrap replicate and should be supplied through the . . . argument to tsboot. |
R |
A positive integer giving the number of bootstrap replicates required. The default value is 100. |
nsteps |
A positive integer with the number of steps (iterations) in the HHJ algorithm. The default value is 5. |
l.init |
A positive integer smaller then the number
of observations (n.obs.) in |
type.optm |
0 for mean of the parameters vector or a positive integer giving the index of the desired parameter to optimize in the same order as provided by statistic. For more details see the section "Details" bellow.#' |
type.est |
A character describing the type of estimation being undertaken. Accepted values are: "bias.variance" and "distribution.quantile". The default value is 'bias.variance'. |
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 HHJ. |
seed |
Numeric, the seed to |
packages |
If |
export |
If |
... |
Extra argumetns to |
This functions implements the iterative version of the
Lahiri, Furukawa and Lee (2005) algorithm. Here some
modifications are implemented in the fashion of Barroso
(2017). Namely, a vectorized algorithm is implemented
where the user might supply which parameter to optimize
over or use a default value. The default value is obtained
by minimizin the mean MSE vector (if a vector or
parameters is returned by statistic). For the MBB step
the tsboot2
,a modification of the
tsboot
function from the
boot package, is used.
A dataframe, the first column for the iteration step the second and third for the estimated optimal block length.
For bugs and further requests please refer to https://github.com/matheusbarroso/dboot
Matheus de Vasconcellos Barroso
Kunsch, Hans R. 1989. The Jakknife and the Bootstrap For General Stationary Observations. The Annals of Statistics. 1989, Vol. 17, 3, pp. 1217-1241.
Lahiri, Soumendra, Furukawa, Kyoji and Lee, Yd. 2007. A nonparametric plug-in rule for selecting optimal block lengths for block bootstrap methods. Statistical Methodology. July, 2007, Vol. 4, 3, pp. 292-321.
Barroso, Matheus de V. 2018. BOOTSTRAP METHODS FOR GENERALIZED AUTOREGRESSIVE MOVING AVERAGE MODELS
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
LFL(db,bootf,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.