2

I have a very noisy time series like this and I forcast future values with auto.arima from the forecast package in R:

set.seed(123)
y <- diffinv(rnorm(100))

plot(forecast(auto.arima(ts(y))))

enter image description here

I am quite happy with this forecast. However, in my data, sometimes extreme outliers can happen, for example:

y[100] <- -10

plot(forecast(auto.arima(ts(y))))

These completely destroy my forecast. How can I make it so that ARIMA is robust to those outliers or would I have to detect and remove these outliers separetly?

enter image description here

spore234
  • 1,323
  • 1
  • 15
  • 31
  • You may be interested in [this answer](https://stats.stackexchange.com/questions/169468/how-to-do-forecasting-with-detection-of-outliers-in-r-time-series-analysis-pr/173684?s=2|28.2897#173684) and the [tsoutliers](https://cran.r-project.org/package=tsoutliers) package of R. – javlacalle Aug 15 '18 at 20:30

1 Answers1

1

ARIMA on its own can't really handle outliers. You need to use tsclean or some other similar preprocessing method.

Skander H.
  • 10,602
  • 2
  • 33
  • 81