methods-fitted: Extract GARCH Model Fitted Values

Description Details Methods Note Author(s) Examples

Description

Extracts fitted values from a fitted GARCH object.

Details

The function extracts the @fitted value 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 fitted values.

Note

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

Author(s)

Diethelm Wuertz for the Rmetrics R-port.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Swiss Pension fund Index -
   x = as.timeSeries(data(LPP2005REC))
  
## garchFit - 
   # Fit LPP40 Bechmark:
   fit = garchFit(LPP40 ~ garch(1, 1), data = 100*x, trace = FALSE)
   fit
   
## fitted - 
   # Fitted values are now a "timeSeries" oject:
   fitted = fitted(fit)
   head(fitted)
   class(fitted)
   
## slot - 
   # The slot contains a numeric Vector:
   fitted = slot(fit, "fitted")
   head(fitted)
   class(fitted)

Example output

Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics


Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org

Title:
 GARCH Modelling 

Call:
 garchFit(formula = LPP40 ~ garch(1, 1), data = 100 * x, trace = FALSE) 

Mean and Variance Equation:
 LPP40 ~ garch(1, 1)
 [data = 100 * x]

Conditional Distribution:
 norm 

Coefficient(s):
       mu      omega     alpha1      beta1  
0.0491045  0.0083931  0.0881844  0.8016406  

Std. Errors:
 based on Hessian 

Error Analysis:
        Estimate  Std. Error  t value Pr(>|t|)    
mu      0.049104    0.013478    3.643 0.000269 ***
omega   0.008393    0.003493    2.403 0.016268 *  
alpha1  0.088184    0.035316    2.497 0.012524 *  
beta1   0.801641    0.071544   11.205  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log Likelihood:
 -38.61265    normalized:  -0.1024208 

Description:
 Fri Nov 17 02:32:56 2017 by user: anon 

2005-11-01 2005-11-02 2005-11-03 2005-11-04 2005-11-07 2005-11-08 
 0.0199980 -0.1120404  0.3317548  0.2421248  0.2246611  0.0962708 
[1] "numeric"
2005-11-01 2005-11-02 2005-11-03 2005-11-04 2005-11-07 2005-11-08 
0.04910448 0.04910448 0.04910448 0.04910448 0.04910448 0.04910448 
[1] "numeric"

fGarch documentation built on Nov. 17, 2017, 2:15 p.m.