theorangedog.net

Tag: Currency Trading

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 x_t=x_{t-1}+epsilon_t. This requires that the error term epsilon_t has a constant variance and is uncorrelated with previous error terms.

This equation states that the best predictor for any x is x_{t-1} 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:
y_t=b_0+b_1y_{t-1}+epsilon_t where y_t=x_t-x_{t-1}small.

If the series is indeed random, we would expect that b_0 and b_1 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.

4 Comments :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Try Google.

Endurance

The best long distance runners eat raw meat, run naked, and sleep in the snow.