Monthly Archives: February 2015

ARIMA models are not perfect.

ARIMA models are usually a great and straightforward way to forecast a time series with certain assumptions. However, when these fail, ARIMA models are not able to respond properly. Let me illustrate this with a hands-on example with R.

We will use the tseries and forecast packages.


series = flow.vat

We immediately check that this series follows a pattern: at the beggining of each year, predictions should become more volatile as the value goes up. Well, let’s check how ARIMA models behave.

ari = auto.arima(flow.vat)


This prediction is quite useless, despite the fact that the confidence interval width is rising as time passes. If anyone’s interested in fitting a GARCH model to the data, I tried GARCH(1,1) and (2,2) with similar results.

Time to check neural nets! Lagged inputs can be use to feed a one-layer hidden neural net Ă  la regression. (For a quick tutorial on how these work, check

model = nnetar(flow.vat)


Neat! Neural nets seem to capture the pattern of the series pretty well. However, due to the nature of the approach, a confidence interval for the prediction is unavailable.