predict-methods {fGarch}R Documentation

GARCH Prediction Function

Description

Predicts a time series from a fitted GARCH object.

Usage

## S4 method for signature 'fGARCH':
predict(object, n.ahead = 10, trace = FALSE, mse = c("cond","uncond"),plot=FALSE,nx=NULL,crit_val=NULL,conf=NULL,...)

Arguments

n.ahead an integer value, denoting the number of steps to be forecasted, by default 10.
object an object of class fGARCH as returned by the function garchFit.
trace a logical flag. Should the prediction process be traced? By default trace=FALSE.
mse If set to "cond", meanError is defined as the conditional mean errors sqrt{E_t[x_{t+h}-E_t(x_{t+h})]^2}. If set to "uncond", it is defined as sqrt{E[x_{t+h}-E_t(x_{t+h})]^2}.
plot If set to TRUE, the confidence intervals are computed and plotted
nx The number of observations to be plotted along with the predictions. The default is round(n*0.25), where n is the sample size.
crit_val The critical values for the confidence intervals when plot is set to TRUE. The intervals are defined as hat{x}_{t+h} + crit_val[2] * meanError and hat{x}_{t+h} + crit_val[1] * meanError if two critical values are provided and hat{x}_{t+h} pm crit_val * meanError if only one is given. If you do not provide critical values, they will be computed automatically.
conf The confidence level for the confidence intervals if crit_val is not provided. By default it is set to 0.95. The critical values are then computed using the conditional distribution that was chosen to create the object with garchFit using the same shape and skew parameters. If the conditionnal distribution was set to "QMLE", the critical values are computed using the empirical distribution of the standardized residuals.
... additional arguments to be passed.

Value

returns a data frame with the foloowing columns: "meanForecast", meanError, and "standardDeviation".
The number of records equals the number of forecasting steps n.ahead.

Methods

object = "ANY"
Generic function.
object = "fGARCH"
Predict function for objects of class "fGARCH".

Author(s)

Diethelm Wuertz for the Rmetrics R-port.

Examples

## garchFit - 
   # Parameter Estimation of Default GARCH(1,1) Model:
   set.seed(123)
   fit = garchFit(~ garch(1, 1), data = garchSim(), trace = FALSE)
   fit

## predict -
   predict(fit, n.ahead = 10)
   predict(fit, n.ahead = 10,mse="uncond")

## predict with plotting: critical values = +- 2

   predict(fit, n.ahead = 10, plot=TRUE, crit_val=2)

## predict with plotting: automatic critical values 
## for different conditional distributions

  set.seed(321)
  fit2 = garchFit(~ garch(1, 1), data = garchSim(), trace = FALSE, cond.dist="sged")

## 95
 predict(fit2,n.ahead=20,plot=TRUE) 

 set.seed(444)
 fit3 = garchFit(~ garch(1, 1), data = garchSim(), trace = FALSE, cond.dist="QMLE")

## 90

 predict(fit3,n.ahead=20,plot=TRUE,conf=.9,nx=100) 


[Package fGarch version 2110.80 Index]