Test for Random Walk in Time Series
by theorangedog on Jan.27, 2008, under Skills
One of my most-viewed posts concerns the Dickey Fuller test, and the most downloaded document is the Dickey Fuller example.
So, I thought I’d expand on that in a series of posts as it is an area of interest for me, and obviously many others out there.
Let’s start with the idea of a Random Walk. A time series is a random walk if it is explained by the equation
. This requires that the error term
has a constant variance and is uncorrelated with previous error terms.
This equation states that the best predictor for any
is
for any period after t-1. So, let’s start by testing a set of financial time series to see if it is a random walk.
If you go to the Federal Reserve website, you can download data for a number of currencies. I downloaded the data for the Pound, and opted to use the dates Jan 01, 2007 to Dec 31, 2007. The spreadsheet used is attached here.
Notice that the t-value for the intercept is 1.72, meaning the intercept is not significantly different than zero. Also, the lagged variable slope coefficient is .977, which is very close to the value of 1 we would expect for a random walk. However, a random walk is not covariance stationary, meaning it does not have a fixed mean and variance, thus the t-test for this variable is unreliable.
So, how can we confirm out suspicion that this time series is a random walk? We can regress the first differences of the series. Essentially, we look at the equation:
where
.
If the series is indeed random, we would expect that
and
would be equal to zero. The results of that test are attached here. Notice that both regression coefficients are not statistically significantly different from zero. Also, I added an autocorrelation measure and t-test to go with the error terms. These measures show that there is no first lag autocorrelation in the model.
Thus, we can conclude that the exchange rate for the Great British Pound followed a random walk in 2007. That’s a good starting point.




February 3rd, 2008 on 5:59 pm
I’m finding this very very helpful… please continue…
February 6th, 2008 on 5:01 pm
glad to hear it is helpful, the next couple of installments will come very shortly - just returned from Seattle and have to catch up.
February 10th, 2008 on 6:02 pm
[...] with two time series variables using least squares. The intent was to build upon my prior post, Test for Random Walk in Time Series. In an upcoming post, I will provide the results (and excel spreadsheets) that result in one of the [...]
June 4th, 2009 on 11:55 pm
Dear,
I have tried a lot to get the Dickey Fuller example but there is some error on your website and I am not being able to get it.Please see if you could please send me the example plus teh Dickey Fuller details by email.I am stuck with how to put the stationarized series (with say 2 differences) variable in the original OLS and then to interpret it.I am hopeful of solving the same through your example.Best regards