# Time-series stationarity

If I difference a time series and take out trend and seasonality ... does it mean we are left with only irregularity on which we plot the acf and pacf to arrive at the MA and AR order?

Do 1st difference, 2nd difference always detrend the series, or do we need to detrend separately?

• To take out seasonality you need to first check if you time series is stationary. If it is I suppose your logic holds. – dfhgfh Jan 15 '13 at 14:47

## 1 Answer

Differencing does not automatically de-trend a time series. For a counter-example, consider data generated by any process characterized by exponential growth (biological populations, share prices) or decay (radioactivity).

Even if the original process is a stationary ARMA process plus a trend, differencing will still not have the effect of detrending the series. For example, let $x_t$ be such a series: $x_t = \mu(t) + y_t$ where $y_t$ is a stationary ARMA process. Let $z_t$ denote the differenced process: $z_t = x_t - x_{t-1} = \mu(t) - \mu(t-1) + y_t - y_{t-1}$. Then $E[z_t] = \mu(t) - \mu(t-1) + E[y_{t}] - E[y_{t-1}] = \mu(t) - \mu(t-1) \neq 0.$ Differencing multiple times will likewise not yield a stationary series.

In general you may need to do more complicated transformations than differencing (e.g., taking logs, apply a Box-Cox transformation) before you can treat the transformed series as a stationary ARMA process.

• Thanks Arthur.Then is differencing just taking out the seasonality effect?and do we need to first differentiate and then detrend the series before we decide the order of AR and MA? Does it also mean we are then left with only the error term on which we decide order of AR and MA depending on ACF and PACF plot? – user1921899 Jan 16 '13 at 4:31
• stats.stackexchange.com/questions/44342/… was the link I was initially looking at but wanted to double check – user1921899 Jan 16 '13 at 4:39
• Differencing is most useful for analyzing series with unit roots, e.g., AR processes with coefficients equal to (or close to) unity. Consider the simplest such case in which $y_t$ follows a random walk, i.e., in which $y_t = y_{t-1} + e_t$. This process is non-stationary. However, the differenced series is stationary. Ref: en.wikipedia.org/wiki/Unit_root – Arthur Small Jan 16 '13 at 5:05
• ok.However if its not unit root ,in that case do we need to detrend in addition to de-seaseasonalize? and then try to find out order of AR and MA on the error term and use the order to predict sales ie the original data? – user1921899 Jan 16 '13 at 5:30