# Stationarity: time series vs regression

I have been thinking about the following question recently. As an econometrics major I'm not sure how to answer this properly.

When trying to predict a time series data, one of the first things you look into is mean stationarity, the data shouldn't have any trend in order to make accurate predictions. However, in my new job I have noticed that they use OLS regression in order to analyse and predict a certain variable y. Among the different explanatory variables they use, they have the lagged values of y. What is strange to me is that they don't check for stationarity and the predictions they make are accurate.

The thing is, I have never though about it this way and was wondering; why there is no need to check check for stationarity in OLS while when we use time series we must do it? Does it have to do with the fitting algorithm we use(OLS against ML)?

Thanks.

• Some notes: OLS is a fitting algorithm, just like ML. A regression model is somewhat hard to define, see here. A time series is a type of data. Now you can take a type of data, use a model for it and estimate the model with an estimation algorithm. Consider an autoregression; it is a regression model for times series data, and OLS is used to estimate it. This is quite close to what you are describing. – Richard Hardy Jan 29 '18 at 20:17
• autobox.com/dave/regvsbox.pdf (which I authored) discusses issues/differences/opportunities/pitfalls when dealing with time series that your possible regression solutions may be ignoring OR even worse injecting per @Aksakal's comments – IrishStat Jan 29 '18 at 20:19
• How does stationarity fit in? I think it is relevant for the model and for its estimation. A model must account for possible nonstationarity as otherwise it will fail to adequately reflect the data generating process. Some estimation algorithms do not deliver desirable results under nonstationarity. E.g. the estimates of the model parameters may be inconsistent under nonstationarity. But not always. If $y_t$ is nonstationary because it is integrated, you can still run a regression of $y_t$ on $y_{t-1}$ and get a consistent estimate of the slope coefficient with OLS. – Richard Hardy Jan 29 '18 at 20:21

Some notes: OLS is a fitting algorithm, just like ML. A regression model is somewhat hard to define, see this thread. A time series is a type of data. Now you can take a type of data, use a model for it and estimate the model with an estimation algorithm. Consider an autoregression; it is a regression model for times series data, and OLS is used to estimate it. This is quite close to what you are describing.

How does stationarity fit in? It is relevant for the model and for its estimation. A model must account for possible nonstationarity as otherwise it might fail to adequately reflect the data generating process. Moreover, estimation algorithms often do not deliver quality results under nonstationarity, e.g. the estimates of the model parameters become inconsistent. But this is not always the case. If $y_t$ is nonstationary because it is integrated of order one, i.e. I(1), you can still run a regression of $y_t$ on $y_{t−1}$ and get a consistent estimate of the slope coefficient with OLS. This is again something that you have observed.

• Thanks for the reply, lets say my Y is I(0) but one of my X variables is X(0), will this be a problem? As I understand it , you wont be able to obtain reliable estimates with a constant beta since your X will be getting larger(or lower). Your beta will give you the slope of the best line that fits the data which will have big errors in both extremes. However, if the X is i(0) and the Y is I(1) you wont be able to capture the trend component of Y. This leaves you with two possibilities, use two variables that are I(0) or I(1). Or you could use a mix of variables X that are I(0) and I(1). – juan freire Feb 1 '18 at 15:57
• @juanfreire, you are correct. You need the order of integration of the left hand side of the equation to be matched with the one of the right hand side. I am not sure what you meant by lets say my Y is I(0) but one of my X variables is X(0), will this be a problem? – Richard Hardy Feb 1 '18 at 17:08
• Sorry, i meant X is I(1) – juan freire Feb 1 '18 at 20:19
• @juanfreire, yes, if there is a disbalance between orders of integration on the different sides (only one of the Xs is integrated and so there is no cointegration between the Xs that could make the right hand side non-integrated) then there will be a problem. – Richard Hardy Feb 1 '18 at 20:33
• @juanfreire, no problem :) – Richard Hardy Feb 21 '18 at 14:19

In time series the data is ordered. It makes a big difference. For instance, is OLS you have a typical model: $$y_i=c+\phi x_i+e_i$$ Here, there is no particular order in the index $i$. You might be measuring the output (GDP) of countries indexed by $i$, and it doesn't matter in each order you add them to the data set.

In time series instead of some random sample $i$ you get the ordered time intervals $t$. Now if you look at the US GDP time series, the observations come in a very particular order.

Also, stationarity is a time series version of the exogeneity. It's a weakened version of exogneity requirement from OLS. So, it's not like OLS doesn't care at all about these issues. It does, but time series due to its time ordering complicates the things, so econometricians came up with a weaker version of exogeneity. It allows to do something. Note how in time series a well known Gauss-markov conditions are losened up a bit.

In dynamic model such as you mentioned with lagged dependent variable as a regressor, some benign (in OLS) problems become serious issues, e.g. autocorrelation in residuals.

Does it have to do with the fitting algorithm we use(OLS against ML)?

Yes. Stationarity is a condition for some time series models, but not others. It is required for ARMA models. ARIMA models are used when the time series is not stationary to transform it so that it is suitable for ARMA modeling. Exponential smoothing forecasting methods on the other hand don't require stationarity.

What is strange to me is that they don't check for stationarity and the predictions they make are accurate.

Checking for stationarity isn't about improving the accuracy of the model per se , it is about keeping the model stable. See this post and this post. Trying to fit an ARMA model to non stationary data would lead to a model that diverges very quickly.

they use OLS regression in order to analyse and predict a certain variable y. Among the different explanatory variables they use, they have the lagged values of y.

It is possible that the data is already stationary by nature - which is why OLS works on the lagged values of y without any transformations.

Also, for the case of ARIMA models, ML is used only if moving average terms are used. If only auto-regressive terms are used that OLS works. From what you describe they don't have any moving average terms in the explanatory variables.

It is possible that the data is already stationary by nature - which is why OLS works on the lagged values of y without any transformations.

Also, for the case of ARIMA models, ML is used only if moving average terms are used. If only auto-regressive terms are used that OLS works. From what you describe they don't have any moving average terms in the explanatory variables.

Note: The above argument seems realistic. What happens the application of lagged dependent variable in OLS or the ML in ARIMA actually cancels out the most of the effects of the higher orders say the trend effects or cyclical effects in the terms of moving average. That's why, even if both processes are non-stationary processes, but they remain cancelled out and do not become visible in the residual error component even if individual Tests of UNIT roots will show I(1) characteristics.