4

I use R for time series analysis. I would like to evaluate decomposition algorithms. decompose and stl from "stats" package lead to good results but often, the residuals are not meaningless.

Example:

dec <- decompose(AirPassengers)
Box.test(dec$random[7:138], lag = 24, type = "Ljung")
> p-value < 2.2e-16

There is still a lot of autocorrelation in the residuals, the same for decompose with type = "multiplicative" and for stl. If possible, I would like to extract all meaningful information from the residuals. Thus, I had a look on classical forecasting techniques:

library(forecast)
dec <- auto.arima(AirPassengers)
Box.test(dec$residuals, lag = 24, type = "Ljung")
> p-value = 0.01356

Fitting a SARIMA model leads to less autocorrelation and thus, better "information extraction". For p > 0.05, one could argue for a Gaussian error distribution.

Is there a way to decompose the ARIMA fit into slowly varying components and oscillating components like with classical decomposition techniques?

Richard Hardy
  • 54,375
  • 10
  • 95
  • 219
lkegel
  • 51
  • 1
  • Interesting question. I strongly suspect that the answer is "no", but perhaps someone has a clever hack. (Incidentally, we don't have anything [tagged both "decomposition" and "arma"](http://stats.stackexchange.com/questions/tagged/decomposition+arma) or ["decomposition" and "arima"](http://stats.stackexchange.com/questions/tagged/decomposition+arma).) – Stephan Kolassa May 25 '16 at 15:12
  • Ignoring outliers leads to mismodeling. There is a big outlier in March of the last year that really impacts the model. In fact, it is why LOGS was used when in fact it wasn't ever need. https://twitter.com/tomdireill/status/708029337883320320 – Tom Reilly May 25 '16 at 18:05
  • Lars, beware of extracting too much. Trying to eliminate any and all patterns completely may result in detection of spurious patterns. Some patterns may just be due to chance. You note correcly that all *meaningful* information is of interest, though. – Richard Hardy May 25 '16 at 19:54
  • 1
    Thanks, @RichardHardy. I totally agree that one should not try to find too much meaningful information in noise. I am just surprised that a SARIMA model, that someway detrends and deseasonalizes a series for calculating an ARMA model, leaves less meaningful residuals than usual decomposition techniques do. Thus, I wonder whether trend and season could be retrieved. – lkegel May 26 '16 at 12:19

0 Answers0