Skip to content
All library documents

GJR-GARCH Support Differs Between R’s rugarch and fGarch Packages

Article Quant Q&A · Author: scrps93

Summary

This exchange explains a package compatibility issue in R for estimating GJR-GARCH volatility models, with a VaR forecast as the intended application. The central point is that model support depends on the package: `rugarch` provides GJR-GARCH through its own specification and estimation functions, while `fGarch` uses `garchFit` and appears not to accept a GJR-GARCH variance specification.

The evidence cited is an error from `garchFit` stating that its variance formula must be regular GARCH or APARCH, along with package documentation references mentioned in the answer. The practical lesson is to use functions within the package that supports the desired specification rather than assume similarly named R packages share model syntax. The exchange does not provide fitting code for `rugarch`, discuss parameter estimation or diagnostics, or compare VaR forecast quality. Its conclusion about `fGarch` is based on the reported error and documentation rather than a broader package audit.

Key ideas

  • The `rugarch` package supports GJR-GARCH through its own model functions.
  • The `fGarch` package’s `garchFit` function uses a different interface and does not appear to accept GJR-GARCH specifications.
  • An error listing supported variance formulas can help identify whether a package implements the intended model.
  • Package names and related modeling concepts do not imply that functions share syntax or capabilities.
  • The exchange does not evaluate the resulting volatility or VaR forecasts.

Tags

Full text
# GJR-GARCH model using garchFit function


# GJR-GARCH model using garchFit function












I'm trying to use the `garchFit` function described here in order to define a GJR-GARCH model to estimate volatility and then forecast VaR.

I tried using `ugarchspec` to estimate the model but it didn't work, so I was wondering if it was possible to estimate it using the `garchFit` function I linked

## Answer by Bob Jansen (score 0, accepted)

https://quant.stackexchange.com/a/44454

The `ugarchspec()` function is part of the `rugarch`-package which works with the `rugarch` set of functions. `rugrach` does support GJR-GARCH. The `fGarch`-package works differently, you can call `garchFit()` directly. It seems to me that `fGarch` does not support any other GARCH specification than regular GARCH or APARCH, as suggested by this error message:

```
> garchFit(~ gjrgarch(1,1), data = x.vec, trace = FALSE)
Error in .garchInitSeries(formula.mean = formula.mean, formula.var = formula.var,  : 
  formula.var must be one of: garch, aparch
```

This question and the overview given by `library(sos); ???gjr` suggest that the authors of `fGarch` mention GJR-GARCH but didn't implement it (yet).

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.