# Is residuals autocorrelation always a problem?

I read that OLS underestimates variance when residuals are autocorrelated. I see why autocorrelation would be a problem in time series analysis, in the sense that the coefficient are not efficient because we're not including all the potential predictors. But is there a mathematical problem as well?

For example, we want to predict the used-cars sales margins. The data set includes each vehicle make, model, mileage p/gallon, price, options etc. and the final sale price. For some reason the catalog has been sorted by car make and year/model, so adjacent observations will likely have similar sale numbers. Is autocorrelation a problem in this case?

-
It seems like the issue is heteroskedasticity, but if you're talking about panel data, then it might be both. People typically use Newey-West errors to deal with these issues. –  John Aug 27 '14 at 15:18
I will offer a provisional "you are clear", although provisional because autocorrelation outside time-series or spatial series is a bit outside my ken. –  Alexis Aug 27 '14 at 18:52
Have you examined the OLS output after re-sorting your data? (If not, you might consider trying it: just permute the cases randomly or sort them on some other variables.) Only the things that change in the output will be of concern to you (insofar as the sorting goes) :-). –  whuber Aug 27 '14 at 20:13
How your data is sorted has nothing to do with regression output (this is what whuber was trying to show to you by asking you to rerun). And also nothing to do with autocorrelation or heteroskedasticity or clustered errors or any problems that may show up. –  Affine Aug 28 '14 at 13:07
@Affine Of course it has to do with the autocorrelation of residuals. If you change the order of the data set (and thus the order of residuals) you will have different correlation values at lag $x$. –  Robert Kubrick Aug 28 '14 at 14:42

Correlated residuals in time series analysis may imply far worse than low efficiency: if the structure of autocorrelation implies integrated or near-integrated data, then any inferences about levels, means, variances, etc. may be spurious (with unknown direction of bias) because the population mean is undefined and the population variance is infinite (so, for example, the finite values $\bar{x}$ and $s_{x}$, and quantities derived from these are always false estimates of the corresponding population statistics).

That's not a problem that can be resolved by increasing sample size to offset inefficiency.

If autocorrelated errors obtain in OLS, I would say that the same issues may be present (it depends on the data generating process). Again: not an issue of efficiency.

The critical caveat is whether ordering of your data is meaningful: if the order has meaning in that it relates to the data generating process then you're in trouble.

-
Data ordering is not critical, as I explained in the example. I'm still not clear why the estimates would be wrong in this case. –  Robert Kubrick Aug 27 '14 at 16:40

1) The time series auto-correlation you refer is the correlation between a time series and the time-shifted series; "time" is observed when the data are collected. In your example, auto-correlation by shifting car maker or model is not very meaningful. For new cars, shifting year (comparing year over year sales of the same type of car) makes sense, but for used cars it would be less meaningful, since the random usage the car would have being exposed to would erase correlations if there was one. I think you are fine going ahead applying the OLS technology

2) You would be fitting an unbiased linear estimator, a special case of an M-estimator. If your objective is to build a predictive model (as oppose to testing hypothesis expresable in terms of model parameter), then the OSL is appropiate. To cover for the possibility un-met model assumptions, use a training to build your model, and a validation sample to assess its performance on out-of-sample cases.

-