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?