residuals-methods {fGarch}R Documentation

Extract GARCH Model Residuals

Description

Extracts residuals from a fitted GARCH object.

Usage

## S4 method for signature 'fGARCH'
residuals(object, standardize = FALSE)

Arguments

object

an object of class "fGARCH" as returned from the function garchFit.

standardize

a logical flag, should the residuals be standardized?

Details

The function extracts the @residuals slot from an object of class "fGARCH" as returned by the function garchFit.

The class of the returned value depends on the input to the function garchFit who created the object. The returned value is always of the same class as the input object to the argument data in the function garchFit, i.e. if you fit a "timeSeries" object, you will get back from the function fitted also a "timeSeries" object, if you fit an object of class "zoo", you will get back again a "zoo" object. The same holds for a "numeric" vector, for a "data.frame", and for objects of class "ts", "mts".

In contrast, the slot itself returns independent of the class of the data input always a numceric vector, i.e. the function call rslot(object, "fitted") will return a numeric vector.

Methods

object = "ANY"

Generic function

object = "fGARCH"

Extractor function for residual from an object of class "fGARCH".

Note

residuals is a generic function which extracts residual values from objects returned by modeling functions.

Author(s)

Diethelm Wuertz for the Rmetrics R-port.

Examples

## Swiss Pension func Index -
   x = as.timeSeries(data(LPP2005REC))
  
## garchFit
   fit = garchFit(LPP40 ~ garch(1, 1), data = 100*x, trace = FALSE)
   fit
   
## residuals - 
   res = residuals(fit)
   head(res)
   class(res)
   
## slot - 
   res = slot(fit, "residuals")
   head(res)

[Package fGarch version 2110.80.1 Index]