Basic Concepts
A random walk time series y1, y2, …, yn takes the form
where
If δ = 0, then the random walk is said to be without drift, while if δ ≠ 0, then the random walk is with drift (i.e. with drift equal to δ).
It is easy to see that for i > 0
It then follows that E[yi] = y0 + δi, var(yi) = σ2i and cov(yi, yj) = 0 for i ≠ j. The variance values are not constants but vary with time i, and so this type of time series is not stationary. Also, the mean values are constant only for a random walk without drift.
Note too that since cov(εi,εj) = 0 for i ≠ j, it follows that
Note that the first difference zi = yi – yi-1 of a random walk is stationary since it takes the form
which is a purely random time series.
Plot
Example 1: Graph the random walk with drift yi = yi-1 + εi where the εi ∼ N(0,.5).
The graph is shown in Figure 1. All the cells in column B contain the formula =NORM.INV(RAND(),0,.5), cell C4 contains the formula =1+B4 and cell C5 contains the formula =1+B5+C4.
As we can see, the graph shows a clear upward trend and the ACF shows a slow descent.
Figure 1 – Random Walk
First differences are taken between the y values as shown in Figure 2. E.g. cell C5 contains the formula = B5-B4 (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 – First differences of a random walk
Hello Charles,
Your website is extraordinary. Excellent. I am understanding Time Series in a better way.
Hi Samir,
Glad I could help.
Charles