The Southern Oscillation Index (SOI) is an indicator of the development and intensity of El Niño (negative SOI) or La Niña (positive SOI) events in the Pacific Ocean. These data also included the estimate of “recruitment”, which indicate fish population sizes in the southern hemisphere.
All happy families are alike; each unhappy family is unhappy in its own way.
Tolstoy, Anna Karenina
This applies to time series models as well, just replace happy family with stationary model.
A simple example of a non-stationary time series is a trend stationary model
\[ y_t = \mu(t) + w_t \]
where \(\mu(t)\) denotes a time dependent trend and \(w_t\) is a white noise (stationary) process.
Linear trend model
Lets imagine a simple model where \(y_t = \delta + \beta t + x_t\) where \(\delta\) and \(\beta\) are constants and \(x_t\) is a stationary process.
Differencing
An simple approach to remove trend is to difference your response variable, specifically examine \(d_t = y_t - y_{t-1}\) instead of \(y_t\).
Detrending vs Differencing
Quadratic trend model
Lets imagine another simple model where \(y_t = \delta + \beta t + \gamma t^2 + x_t\) where \(\delta\), \(\beta\), and \(\gamma\) are constants and \(x_t\) is a stationary process.
Detrending
2nd order differencing
Let \(d_t = y_t - y_{t-1}\) be a first order difference then \(d_t - d_{t-1}\) is a 2nd order difference.
Differencing
Differencing - ACF
AR Models
AR(1)
Last time we mentioned a random walk with trend process where \(y_t = \delta + y_{t-1} + w_t\).
The AR(1) process is a generalization of this where we include a coefficient in front of the \(y_{t-1}\) term.