# Why is the ACF diagram showing seasonal patterns when they should have been removed by decompose?

I'm reading the book Introductory Time Series with R where the following code is given:

 > data(AirPassengers)
> AP <- AirPassengers
> AP.decom <- decompose(AP, "multiplicative")
> acf(AP.decom$random[7:138])  A screenshot of the ACF diagram from the book is shown below: The book then states: The correlogram in Figure 2.8 suggests either a damped cosine shape that is characteristic of an autoregressive model of order 2 (Chapter 4) or that the seasonal adjustment has not been entirely effective. The latter explanation is unlikely because the decomposition does estimate twelve independent monthly indices. ... Question 1: The text says that it is unlikley that the seasonal adjustment has not been effective, however, if that is the case, why are seasonal patterns still visible in the ACF diagram? The book then goes on to say ... ... If we investigate further, we see that the standard deviation of the original series from July until June is 109, the standard deviation of the series after subtracting the trend estimate is 41, and the standard deviation after seasonal adjustment is just 0.03.  > sd(AP[7:138]) [1] 109 > sd(AP[7:138] - AP.decom$trend[7:138])
[1] 41.1

> sd(AP.decom\$random[7:138])
[1] 0.0335


The reduction in the standard deviation shows that the seasonal adjustment has been very effective.

Question 2: Why does a reduction in SD show that the seasonal adjustment is effective?

• Have you tried the PACF instead of the ACF? Commented Mar 10, 2019 at 18:50

Note that checking the statistical properties of the residuals is a crucial step diagnostic model checking. Our objective is to fit the a model that "squeezes that data dry", i.e. we get residuals that are white noise

Now with regards to your questions

1. The ACF of the residuals does NOT necessarily imply seasonality has not been removed. It might well be that the residuals follow an AR(2) process. Note that the ACF of an AR(2) is of the form

$$\rho(\tau) = \frac{(1-\lambda_2^2)\lambda_1^{|\tau|+1}- (1-\lambda_1^2)\lambda_2^{|\tau|+1}}{(\lambda_1-\lambda_2)(1+\lambda_1\lambda_2)}$$

where $$\lambda_1, \lambda_2$$ are solutions of $$z^2+a_1z+a_2=0$$

hence when $$\lambda_1=\sqrt{a_2}e^{i\phi},\lambda_2=\sqrt{a_2}e^{-i\phi}$$

(i.e. $$0 \leq a_1^2 < 4a_2$$), $$\phi = cos^{-1}(-a_1/2 \sqrt{a_2}) \in [0,\pi)$$

$$\rho(\tau) = \frac{a_2^{\tau/2}\sin(\tau \phi + \psi)}{\sin \psi}, \tau \geq 0$$ where $$\tan(\psi) = \frac{1+a_2}{1-a_2}\tan \phi$$.

As you may see, in this case ACF has the same form as the one of the screenshot.

1. Lower variance for the residuals means that MSE has been significantly reduced by fitting seasonal components. Hence it is plausible that the most likely explanation for the ACF is the AR(2) structure of the residuals rather than the inadequate explanatory power of the seasonal component.

q1. The decomposition assumes 11 deterministic seasonal factors ... if the data has an autoregesssive structure seasonal dummies are inadequate. On the other hand if the data is correctly modelled with 11 deterministic seas factors then there will be no seasonal acf suggestion in the model residuals. Which is why good software/practice examines both possibilities.

q2. if the variance/sd is significantly reduced that means that there has been an improvement in model structure as suggested by the t values for the additional structure.