A time series with a (linear) deterministic trend can be modeled as
Now E[yi] = μ + δi and var(yi) = σ2, and so while the variance is a constant, the mean varies with time i; consequently, this type of time series is also not stationary.
These types of time series can be transformed into a stationary time series by detrending, i.e. by setting zi = yi – δi. In this case zi = μ + εi, which is a purely random time series.
In a similar fashion we can speak about a quadratic deterministic trend (yi = μ + δi + εi) or various other varieties of deterministic trends.
The types of random walks described previously are said to have a stochastic trend. We can also have random walks with a deterministic trend. These take the form
where δ is a constant. These are not stationary and require differencing and detrending to be transformed into a stationary time series.
Example 1: Graph the time series with deterministic trend yi = i + εi) where the εi ∼ N(0,1).
The graph is shown in Figure 1. All the cells in column B contain the formula =NORM.S.INV(RAND()) and cell C4 contains the formula =A4+B4 (and similarly for the other cells in column C).
As we can see, once again the graph shows a clear upward trend and the ACF shows a slow descent.
Figure 1 – Deterministic Trend
This time we get rid of the trend by detrending as shown in Figure 2. E.g. cell C4 contains the formula = B4-A4 (where column B replicates the values in column C from Figure 1). We see from the chart that the trend has been eliminated. We also see from the Ljung-Box test (cell F13) that the ACF values for the first 7 lags are statistically equal to zero, consistent with a purely random process.
Figure 2 – Detrending






