The Random Walk Theory states that stock price changes are random and unpredictable, with no discernible patterns or trends. This means that future price movements are independent of past movements, implying that it is not possible to predict future prices based on past performance.
To test if stock prices follow a random walk, we can perform a series of statistical tests. Generally, we can follow these steps:
1. Collect and preprocess data: Firstly, gather historical stock prices for the security you’re interested in testing over a representative time period (e.g., several years). Then, calculate the daily returns (percentage change in price) to work with price changes instead of actual prices.
$$R_t = \frac{P_t - P_{t-1}}{P_{t-1}}$$
Where Rt is the return at time t, and Pt and Pt − 1 are the stock prices at times t and t − 1, respectively.
2. Check for stationarity: A time series is stationary if its statistical properties (mean, variance, autocovariance, etc.) do not change over time. Since random walks are inherently non-stationary (due to their cumulative nature), we need to check for stationarity.
For this, you can use the Augmented Dickey-Fuller (ADF) test. The null hypothesis of the ADF test is that the time series is non-stationary. A rejection of the null hypothesis would indicate stationarity, and this would be evidence against a random walk.
3. Test for autocorrelations: If a series follows a random walk, there should be no significant autocorrelations between past and current returns.
Calculate the autocorrelation coefficients for different lags (e.g., 1 day, 5 days, 10 days, 20 days), and use the Ljung-Box test to determine if the autocorrelations are significantly different from zero. The null hypothesis in this test is that the autocorrelations are equal to zero.
If you don’t find significant autocorrelations, this would be consistent with the random walk hypothesis.
4. Variance ratio test: A defining characteristic of the random walk hypothesis is that the variance of price changes over n days should be equal to the variance of daily price changes multiplied by n. The variance ratio test checks this relationship:
$$\text{VR}(n) = \frac{\text{Var}(R_t^n)}{n \cdot \text{Var}(R_t)}$$
Where VR(n) is the variance ratio for an n-day interval, and Var(Rtn) and Var(Rt) represent the variances of n-day and 1-day returns, respectively.
Under the random walk hypothesis, the variance ratio should be approximately 1 for all n. If the variance ratio is significantly different from 1, it suggests that returns may not follow a random walk.
5. Analyze the results: If the results of the various tests are consistent with the random walk hypothesis (i.e., non-stationary, no significant autocorrelations, variance ratios close to 1), this would suggest that the security’s price changes follow a random walk. On the other hand, if the tests provide opposing evidence, the random walk hypothesis may not hold for this security.
It’s important to note that even if a stock’s returns appear to follow a random walk, the Random Walk Theory is not universally applicable, and individual stocks may sometimes exhibit non-random behavior. Additionally, researchers continue to debate this theory, and the question of market predictability and efficiency does not have a definitive answer.