I am trying to forecast a time series object in R with GARCH(1,1) model. My goal is to hav 24 instances ahead forecast with the GARCH model. Although I am using a time series object while forecasting,I get the following error:
Error in is.constant(y) : (list) object cannot be coerced to type 'double'
Those are the commands that I am using:
library(forecast)
library(tseries)
trainer1 <- ts(trainer, frequency=24)
m1 <- garch(trainer1, order = c(1,1))
forecasts1 <- forecast(m1, h=24)
And the sample data that I am using is as follows:
124.30
98.99
64.00
64.00
123.99
123.99
34.97
123.99
139.91
140.00
164.30
178.99
140.00
169.95
161.18
139.94
161.31
124.00
115.01
124.00
Many thanks for your help :)
