Learn R Programming

rugarch (version 1.4-4)

ugarchboot-methods: function: Univariate GARCH Forecast via Bootstrap

Description

Method for forecasting the GARCH density based on a bootstrap procedures (see details and references).

Usage

ugarchboot(fitORspec, data = NULL, method = c("Partial", "Full"), 
sampling = c("raw", "kernel", "spd"), spd.options = list(upper = 0.9, 
lower = 0.1, type = "pwm", kernel = "normal"), n.ahead = 10, 
n.bootfit = 100, n.bootpred = 500, out.sample = 0, rseed = NA, solver = "solnp", 
solver.control = list(), fit.control = list(), 
external.forecasts = list(mregfor = NULL, vregfor = NULL), mexsimdata = NULL, 
vexsimdata = NULL, cluster = NULL, verbose = FALSE)

Arguments

fitORspec

Either a univariate GARCH fit object of class '>uGARCHfit or alternatively a univariate GARCH specification object of class '>uGARCHspec with valid parameters supplied via the setfixed<- function in the specification.

data

Required if a specification rather than a fit object is supplied.

method

Either the full or partial bootstrap (see note).

sampling

Whether to sample from the raw residuals, the kernel-fitted distribution of the residuals or the spd-fitted distribution of the residuals.

spd.options

If sampling is from the SPD distribution, this controls the options for fitting this distribution to the residuals (see spd package for details).

n.ahead

The forecast horizon.

n.bootfit

The number of simulation based re-fits used to generate the parameter distribution (i.e the parameter uncertainty). Not relevant for the “Partial” method.

n.bootpred

The number of bootstrap replications per parameter distribution per n.ahead forecasts used to generate the predictive density. If this is for the partial method, simply the number of random samples from the empirical distribution to generate per n.ahead.

out.sample

Optional. If a specification object is supplied, indicates how many data points to keep for out of sample testing.

rseed

A vector of seeds to initialize the random number generator for the resampling with replacement method (if supplied should be equal to n.bootfit + n.bootpred).

solver

One of either “nlminb” or “solnp”.

solver.control

Control arguments list passed to optimizer.

fit.control

Control arguments passed to the fitting routine (as in the ugarchfit method).

external.forecasts

A list with forecasts for the external regressors in the mean and/or variance equations if specified.

mexsimdata

List of matrices (size of list n.bootpred, with each matrix having n.ahead rows) of simulated external regressor-in-mean data. If the fit object contains external regressors in the mean equation, this must be provided else will be assumed zero.

vexsimdata

List of matrices (size of list n.bootpred, with each matrix having n.ahead rows) of simulated external regressor-in-variance data. If the fit object contains external regressors in the mean equation, this must be provided else will be assumed zero.

cluster

A cluster object created by calling makeCluster from the parallel package. If it is not NULL, then this will be used for parallel estimation of the refits (remember to stop the cluster on completion).

verbose

Whether to print out progress messages.

Value

A '>uGARCHboot object containing details of the GARCH bootstrapped forecast density.

Details

There are two main sources of uncertainty about n.ahead forecasting from GARCH models, namely that arising from the form of the predictive density and due to parameter estimation. The bootstrap method considered here, is based on resampling innovations from the empirical distribution of the fitted GARCH model to generate future realizations of the series and sigma. The “full” method, based on the referenced paper by Pascual et al (2006), takes into account parameter uncertainty by building a simulated distribution of the parameters through simulation and refitting. This process, while more accurate, is very time consuming which is why choice of parallel computation via a cluster (as in the ugarchdistribution is available and recommended). The “partial” method, only considers distribution uncertainty and while faster, will not generate prediction intervals for the sigma 1-ahead forecast for which only the parameter uncertainty is relevant in GARCH type models. If using external regressors, the routine requires both the forecast (of length n.ahead as in the ugarchforecast routine) and a list of simulated forecasts as in the ugarchsim routine (else with be assumed zero). Finally, it is possible to resample based on 3 schemes, namely the “raw” innovations as in the original paper of Pascual et al (2006), “kernel” fits a Gaussian kernel to the innovations from the ks package in order to then generate random samples, and the “spd” fits a semi-parametric distribution to the innovations based on the spd package in order to generate the random samples, for which an optional list (spd.options) may be further passed to the spd fitting routine.

References

Pascual, L., Romo, J. and Ruiz, E. 2004, Bootstrap predictive inference for ARIMA processes, Journal of Time Series Analysis. Pascual, L., Romo, J. and Ruiz, E. 2006, Bootstrap prediction for returns and volatilities in GARCH models, Computational Statistics and Data Analysis.

See Also

For specification ugarchspec, fitting ugarchfit, filtering ugarchfilter, forecasting ugarchforecast, simulation ugarchsim, rolling forecast and estimation ugarchroll, parameter distribution and uncertainty ugarchdistribution.

Examples

Run this code
# NOT RUN {
data(dji30ret)
spec = ugarchspec(variance.model=list(model="gjrGARCH", garchOrder=c(1,1)), 
		mean.model=list(armaOrder=c(1,1), arfima=FALSE, include.mean=TRUE, 
		archm = FALSE, archpow = 1), distribution.model="std")
ctrl = list(tol = 1e-7, delta = 1e-9)
fit = ugarchfit(data=dji30ret[, "BA", drop = FALSE], out.sample = 0, 
				spec = spec, solver = "solnp", solver.control = ctrl,
				fit.control = list(scale = 1))
bootpred = ugarchboot(fit, method = "Partial", n.ahead = 120, n.bootpred = 2000)
bootpred
# as.data.frame(bootpred, which = "sigma", type = "q", qtile = c(0.01, 0.05))
# }

Run the code above in your browser using DataLab