I am trying to obtain the best GARCH model for a simulated series.
# simulate a time series.
tts <- arima.sim(100, model = list(ar = c(-.8), order = c(1, 0, 0)))
# obtain best `GARCH` model for the seies.
tseries::garch(tts, order = c(1, 1), grad = "numerical", trace = FALSE)
Problem
I got this error:
Error in if (object$p != 0 || object$q != 0) { : missing value where TRUE/FALSE needed
What I Want
- How do I fix this error?
- Is there alternative method to obtain
auto-garchmodel other than what I demonstrated above?