Take the 2-minute tour ×
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

When you do an OLS regression and plot the resulting residuals, how can you tell if the residuals are autocorrelated? I know there are tests for this (Durbin, Breusch-Godfrey) but I was wondering if you can just look at a plot to gauge if autocorrelation could be a problem (because for heteroskedasticity it is fairly easy to do so).

share|improve this question
add comment

migrated from math.stackexchange.com Feb 17 '13 at 0:39

This question came from our site for people studying math at any level and professionals in related fields.

2 Answers

up vote 5 down vote accepted

Not only can you look at a plot, I think it's generally a better option. Hypothesis testing in this situation answers the wrong question.

The usual plot to look at would be an autocorrelation function (ACF) of residuals.

The autocorrelation function is the correlation of the residuals (as a time series) with its own lags.

Here, for example, is the ACF of residuals from a small example from Montgomery et al

ACF of residuals for Soft Drink Sales

Some of the sample correlations (for example at lags 1,2 and 8) are not particularly small (and so may substantively affect things), but they also can't be told from the effect of noise (the sample is very small).

Edit: Here's a plot to illustrate the difference between an uncorrelated and a highly correlated series (in fact, a nonstationary one)

White noise and random walk

The upper plot is white noise (independent). The lower one is a random walk (whose differences are the original series) - it has very strong autocorrelation.

share|improve this answer
1  
Thanks for the answer. When you look at the plots on wiki(en.wikipedia.org/wiki/File:Acf_new.svg), can you tell from the upper plot (not the ACF plot) that the residuals are autoccorelated? –  John Doe Feb 17 '13 at 10:31
    
I'd be saying "hmm, looks vaguely cyclical... might be autocorrelation, might not. What's the ACF look like?" –  Glen_b Feb 17 '13 at 11:18
1  
Okay, but could you elaborate on that: For example, I found this question: stats.stackexchange.com/questions/14914/… Apparently, there is autocorrelation. What specifically am I looking for to come to this conclusion? –  John Doe Feb 17 '13 at 12:28
    
Sure, that one shows something that will produce positive autocorrelation (though I'd probably put it down to trend as well as dependence about the trend). Consider - if observations are independent, then think about the chance that a long run of them will be on one side of the mean or the other, with none on the opposite side. I think the best first option is to simulate data that is autocorrelated at various levels and look at it. –  Glen_b Feb 17 '13 at 12:48
1  
I get that you have no autocorrelation when the data is just randomly distributed. But as an indicator for autocorrelation, is it enough when the data is not randomly distributed or do you a kind of pattern (e.g. a data point with a high value is followed by multiple data points with a high value)? –  John Doe Feb 17 '13 at 22:59
show 3 more comments

It's not unusual if 5% or less of the autocorrelation values fall outside the intervals as that could be due to sampling variation. One practice is to produce autocorrelation plot for first 20 values and check whether more than one value falls outside the allowed intervals.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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