1
$\begingroup$

In the book "Time series analysis" by Shumway.

He is doing

fit = lm(chicken~time(chicken), na.action=NULL) 
acf(resid(fit), 48, main="detrended")

What is the point of doing acf on residuals? I do see the point in acf for the data itself... But what's the use doing it for the residuals?

$\endgroup$
1
  • 1
    $\begingroup$ My analysis at stats.stackexchange.com/a/35524/919 applies to this one-dimensional case, too. It shows how trends in the data affect the apparent autocorrelation. $\endgroup$
    – whuber
    Commented Nov 26, 2019 at 23:51

1 Answer 1

2
$\begingroup$

If there is a linear time trend there'd be little point in doing the acf on the raw data; it would be dominated by the common time trend, rather than correlation in the error terms and it would be stronger for a longer series, even though the actual dependence was the same.

I don't think that we're looking at the same edition of the same book (you should give a full reference), but I see the discussion of this data set in the one I have.

Shuway and Stoffer say:

There is an obvious upward trend in the series, and we might use simple linear regression to estimate that trend by fitting the model

then later

In general, it is necessary for time series data to be stationary so that averaging lagged products over time, as in the previous section, will be a sensible thing to do. With time series data, it is the dependence between the values of the series that is important to measure; we must, at least, be able to estimate autocorrelations with precision. It would be difficult to measure that dependence if the dependence structure is not regular or is changing at every time point. Hence, to achieve any meaningful statistical analysis of time series data, it will be crucial that, if nothing else, the mean and the autocovariance functions satisfy the conditions of stationarity

and then

as we suggested in the analysis of the chicken price data presented in Example 2.1, a straight line might be useful for detrending the data; i.e.,

I believe these quotes from the text provide a complete account for why they acted as they did - they remove the estimated linear trend to attempt to achieve mean-variance stationarity (weak stationarity).

They then go on to look at differencing rather than removing a linear trend, and discuss why that might be a better choice.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.