Learn R Programming

fEGarch (version 1.0.1)

predict,fEGarch_fit-method: Multistep and Rolling Point Forecasts

Description

Given a fitted model object from this package, conduct either multistep point forecasts of the conditional means and the conditional standard deviations into the future or rolling point forecasts of arbitrary step size of these quantities for a future test set.

Usage

# S4 method for fEGarch_fit
predict(object, n.ahead = 10, trunc = NULL, ...)

# S4 method for fEGarch_fit predict_roll(object, step_size = 1, trunc = NULL, ...)

Value

Returns an object of class "fEGarch_forecast" that has the two slots @sigt and @cmeans representing the forecasted conditional standard deviations and conditional means, respectively. If the training series saved in object

has a special time series formatting like "zoo" or "ts", the formatting is adopted accordingly to these numeric output series. A third slot @model is the fitted model input object object.

Arguments

object

an object of class "fEGarch_fit", i.e. an object returned by either fEGarch, fiaparch or figarch, etc.; for predict_roll, the slot @test_obs of the fitted model object should not be NULL.

n.ahead

a single numeric value indicating how far into the future the multistep point forecasts should be produced.

trunc

the truncation setting for the infinite-order polynomial of long-memory model parts; the default uses the setting from the fitted input object object.

...

currently without use and included for compatibility with generics.

step_size

the step size of the rolling point forecasts; by default, step_size = 1 is employed, i.e. for the immediately subsequent observation time point for the entire test set.

Details

Use predict to compute multistep point forecasts (of the conditional mean and of the conditional standard deviation) into the future. Let n be the number of observations of the data, to which a model was fitted. Then multistep point forecasts are produced for all future time points from n + 1 to n + n.ahead.

Otherwise, if data was reserved for testing when creating object, e.g. through the use of the argument n_test in the corresponding functions, compute rolling point forecasts over the test set using predict_roll. step_size then determines the forecasting horizon for the rolling point forecasts. For example, step_size = 1, i.e. the default, computes one-step rolling point forecasts, whereas for example step_size = 10 computes ten-step rolling point forecasts (starting at the tenth test time point).

Refitting of models during the rolling point forecast procedure is currently not yet available.

Examples

Run this code
window.zoo <- get("window.zoo", envir = asNamespace("zoo"))
rt <- window.zoo(SP500, end = "2002-12-31")

# Multistep forecasting (EGARCH with cond. normal distr.)
model1 <- fEGarch(spec = egarch_spec(), rt)
fcast1 <- predict(model1, n.ahead = 10)
fcast1

# Rolling one-step forecasts (EGARCH with cond. normal distr.)
model2 <- fEGarch(spec = egarch_spec(), rt, n_test = 250)
fcast2 <- predict_roll(model2, step_size = 1)
fcast2

Run the code above in your browser using DataLab