LFL: LFL-MBB optimal block lenght selection algorithm

Description Usage Arguments Details Value Note Author(s) References Examples

Description

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).

Usage

1
2
3
4
LFL(data, statistic, R = 100L, nsteps = 5L, l.init = NULL,
  type.optm = 0, type.est = "bias.variance", ran.gen = function(tser,
  n.sim, args) tser, ran.args = NULL, allow.parallel = TRUE, seed = 123,
  packages = NULL, export = NULL, ...)

Arguments

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 data (i.e. the length of the time series), indicating the size of the subset in the LFL algorithm. The default value is 'default', in which m.init = round(c1*n.obs.^(1/(r+4)))

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 n.sim observations from tseries by some scheme and converting the result back into a time series of the same form as tseries (with length n.sim). The second argument to ran.gen is always the value n.sim, and the third argument is ran.args, which is used to supply any other objects needed by ran.gen.

ran.args

This will be supplied to ran.gen each time it is called. If ran.gen needs any extra arguments then they should be supplied as components of ran.args. Multiple arguments may be passed by making ran.args a list. If ran.args is NULL then it should not be used within ran.gen but note that ran.gen must still have its third argument.

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 set.seed() for replicable examples.

packages

If allow.parallel = TRUE. A character vector with the lisf of packages required by statisitc.

export

If allow.parallel = TRUE. A character vector with the lisf of objects (functions, etc...) required by statisitc.

...

Extra argumetns to statistic may be supplied here. Beware of partial matching to the arguments of tsboot2.

Details

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.

Value

A dataframe, the first column for the iteration step the second and third for the estimated optimal block length.

Note

For bugs and further requests please refer to https://github.com/matheusbarroso/dboot

Author(s)

Matheus de Vasconcellos Barroso

References

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

Examples

 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)

matheusbarroso/dboot documentation built on May 16, 2019, 8:13 p.m.