Solved – Forecasting: residuals from seasonal decomposition appears to be highly auto-corelated, why

autocorrelationdecompositionforecastingtime series

I am using a publicly available data Kaggle: Rossmann Store Sales and trying to forecast sales. I am using Python.

My timeseries is stationary, confirmed via the Dickey-Fuller test. However, I wanted to perform seasonal decomposition.

I performed seasonal decompositions using statsmodels.tsa.seasonal.seasonal_decompose. And my seasonal decomposition looks like this:
enter image description here

When I plot ACF of residuals there appears to be too much autocorelation!
enter image description here

Am I doing something wrong? or looking at it the wrong way?
My understanding is residuals should show no autocorelation because trend and seasonal have been taken out or adjusted for.

Update 1: Using freq=13 I perform seasonal decomposition and ACF of residuals is given below:
enter image description here

Update 2: As requested by @IrishStat, I am posting the original data

Head(10):
Date
2013-01-01       0
2013-01-02    5737
2013-01-03    5292
2013-01-04    5623
2013-01-05    5018
2013-01-06       0
2013-01-07    9277
2013-01-08    7479
2013-01-09    6681
2013-01-10    6680
Name: Sales, dtype: int64

This is the plot of original data:

enter image description here

Best Answer

You disaggregate a time series into three components -- trend, seasonal and residual.

  • The trend component is supposed to capture the slowly-moving overall level of the series.
  • The seasonal component captures patterns that repeat every season.
  • The residual is what is left. It may or may not be autocorrelated. For example, there can be some autocorrelated pattern evolving quickly around the slowly moving trend plus the seasonal fluctuations. This kind of pattern cannot be ascribed to the trend component (the former moves too fast) or the seasonal component (the former does not obey seasonal timing). So it is left in the remainder.

See also section "Time series decomposition" from Hyndman & Athanasopoulos "Forecasting: principles and practice".

Related Question