I want to run the examples in the help document of the garchFit() function in the fGarch R library, and come against the following error: "Error in terms.formula(formula, data = data) : invalid term in model formula"
Here's the first example in the help document:
# In the univariate case the lhs formula has not to be specified ...
# A numeric Vector from default GARCH(1,1) - fix the seed:
N = 200
x.vec = as.vector(garchSim(garchSpec(rseed = 1985), n = N)[,1])
garchFit(~ garch(1,1), data = x.vec, trace = FALSE)
I am using R version 4.1.3. and version 3042.83.2 of fGarch.
Any suggestions, etc., will be greatly appreciated.
When I run your code, there is no error but only a warning: