# autocorrelation and detrending

Assume that I have observations $Y=[y(x_1),y(x_2),...,y(x_n)]$ from a deterministic but unknown function $y=x^2+\epsilon$ where $\epsilon \sim N(0,\sigma^2)$. Note that $x_j>x_i$ for $j>i$.

Obviously the observations in $Y$ are autocorrelated since they come from the same underlying function, so nearby points have similarities.

However, it seems in many time series models , autocorrelation is only defined after detrending the data. In this case, if I know $x^2$ is the truth then the detrended data ($y-x^2$) , only consists of errors, which are iid and this will result in $\textbf{zero autocorrelation}$.

What is the difference between these two definitions of auto correlation ?

It seems one is based on the observations themselves while the other is based on the residuals. Also , I feel that correlation of observations makes more sense since it indicates an underlying trend, and based on it we may be able to recover the trend.

• What is $x$? Is this your predictor data? If so, then the model you have written has one parameter because $y$ has no intercept and unit slope. Also, I don't really follow when you say "Obviously the observations in Y are [auto]correlated since they come from the same underlying function, so nearby points have similarities." If independent and dependent variables have some time ordering, you should talk about the structure of your errors more – Taylor May 4 '17 at 19:34
• @Taylor Yes $x$ is some predictor variable. Yes we have time ordering here, i.e $x_j>x_i$ for $j>i$ – Wis May 4 '17 at 19:54
• Your question may be answered here. – GeoMatt22 May 4 '17 at 20:21
• There is unconditional autocorrelation in $y$ and conditional (on $x$) autocorrelation in $y$. Both are real objects, and which one to focus on depends on which one you are interested in. – Richard Hardy May 5 '17 at 15:07
• @RichardHardy Thank you. I have 2 small questions. 1) Are the unconditional $y$ observations correlated ? 2) Can I use the ACF test on $y$ given that it is non-stationary (since it has unknown trend) ? – Wis May 5 '17 at 17:16