I have univariate time series data (windspeed at a particular place) measured at 1 hour interval for 5 years.
auto.arima() to get the following parameters:
ar1 ar2 ma1 ma2 intercept 1.5314 -0.55 -0.1261 0.032 10.1223 s.e. 0.0105 0.0103 0.011 0.006 0.1211 sigma^2 estimated as 0.4865 : log likelihood = -83546.65 AIC = 167105.3 AICc = 167105.3 BIC = 167161
I am forecasting using the following equation:
e[t] <- rnorm(1, 0, sqrt(sigma^2)) x[t] <- ar1*x[t-1] + ar2*x[t-2] + e[t] + ma1*e[t-1] + ma2*e[t-2]
When the result is compared with
forecast() function, I get completely different answers. The freq spectrum of
forecast() function's output resembles original time-series freq spectrum. While the manual forecast signal looks like noise in freq spectrum.
I can't use
forecast() function because the application is in C++. Are the equations correct? What's the right way of forecasting from coefficients?