next up previous
Next: About this document ... Up: My Home Page

CSE 691 - Lecture 8 - Random Walk Models

Steven S. Skiena

Dept. of Computer Science

SUNY Stony Brook

Financial Time Series as Random Walks

J. P. Morgan's famous stock market prediction was that ``Prices will fluctuate.''

Bachelier's Theory of Speculation in 1900 postulated that prices fluctuate randomly.

Indeed, simple random processes can generate time series which closely resemble real financial time series.



figure=figures/price.eps,width=6.0in


Such a model makes sense in a world where (1) most price changes result from temporary imbalances between buyers and sellers, (2) stronger price shocks are inherently unpredictable, and (3) under the efficient market hypothesis, where the current price of a stock reflects all information about it.

Caveats

Such a model does not make sense if you believe in technical analysis, where it assume the price trajectory to this point offers insight into the future.

One downside of conventional random walk models is that they predict returns as being normally or log-normally distributed.

As we have seen, such distributions tend to underestimate the frequency of extreme events.

Still, random walks can be very useful in modeling financial risks and returns.

Applications of Random Walks

Estimating the probability distribution for the price of a stock at a given future time $t$ is critical to pricing certain options.

This probability distribution can be modeled as the distribution of positions after $f(t)$ steps of a random walk.

For this question, there is a closed form which can calculate the probability distribution directly, using a normal or binomial distribution (depending upon the random walk model).

However, simulations of random walks enable one to compute the probabilities of more complicated events...

Suppose you want to know the probability that a stock will hit a given price at some point between now and time $t$, or what is the expected high price reached over this interval.

Suppose you want to know the probability a company will go bankrupt at some point between now and time $t$. We can define a company as bankrupt, say, when its capitalization falls to less than its debt minus its assets.

Biased Coin Flipping

A simple discrete random walk model holds that in each step, we move a distance of $1$ either up or down, with the probability $p$ of an upward move and $1-p$ of a downward move.

The path we take as a function of such moves defined a random walk, and is akin to flipping a biased coin.

What is the probability $Pr(h,n,p)$ that we get exactly $h$ heads and $n-h$ tails with a coin that comes up heads with probability $p$?


\begin{displaymath}Pr(h,n,p) =
{\scriptsize\left( \begin{array}{@{}c@{}} n \\ h \end{array} \right) }
p^h (1-p)^{n-h} \end{displaymath}

For an unbiased coin ($p=0.5$), the expected difference between heads and tails is 0, but the expected absolute difference between heads and tails is $O(\sqrt{n})$.

Brownian Motion

Continuous random walk models, called Weiner processes or Brownian motion, can also be considered.

A time series $\{ p_t \}$ is a random walk if

\begin{displaymath}p_t = p_{t-1} + a_t \end{displaymath}

where $\{a_t\}$ is a white noise time series.

Recall that the white noise series is defined by its variance, $\sigma^2$

Under such a model, $p_t$ is not predictable or mean-reverting, but has expected value $p_0$.

Price series that tend to increase with time can be modeled as a random walk with drift:

\begin{displaymath}p_t = \mu + p_{t-1} + a_t \end{displaymath}

Such a time series only makes sense if $\{p_t\}$ reflects the log price, since otherwise the impact of $\{a_t\}$ will diminish with time.

Over short time scales, it is not too wrong to compute percentage changes by adding percentages

Random Walks with Memory

Successive movements in the random walks models to discussed to date are independent, which contradicts our natural perception about how markets move.

Hurst random walks are discrete random walks which reverse direction with probability $h$.

A value of $h=0.5$ generates a coin flipping random walk, while a value of $h=1.0$ generates a walk which moves in only one direction.

Intermediate values of $h$ should generate walks with more ``driven'' than simple coin-flipping, although the eye often mistakenly identifies trends in such walks.

Hurst walks arise in the analysis of fractal phenomenon.

Generating Random Numbers

Simulating random walks require a source of random numbers.

Truly random numbers cannot be produced by a deterministic computer.

Linear congruential generators are a reliable source of random numbers, where

\begin{displaymath}r_n = (a r_{n-1} + c) ~\mbox{mod}~ m \end{displaymath}

for appropriate constants $a$, $c$, and $m$.

Note that the accuracy of a simulation depends on generating truly pseudo-random numbers. Would a random walk alternating up and down look like a price series?

Statistical tests are available for measuring the validity of a random number generator, but library function should be good until you exceed the period where they start to repeat.

Efficient algorithms exist for constructing numbers from a given, non-uniform distribution using a uniform generator.

Volatility Prediction

Stock volatility (measured by the absolute value of returns) tends to show much stronger short term correlation than returns itself.

Lag Volatility Corr. Return Corr.
1 0.441 0.021
2 0.371 -0.016
3 0.337 -0.024
4 0.311 -0.016
5 0.319 0.004
10 0.287 0.005
20 0.249 -0.012
30 0.264 -0.001
40 0.233 0.005
50 0.209 -0.002

We used an exponentially weighted moving average model to predict volatility.

To incorporate the volatility prediction into our random walk model, we must map volatility to parameters for (1) the simulated number of steps per day, and (2) the step size.

We modeled each trading day by a walk of 1000 steps, and adjusted the step size so as to produce the step size to achieve the desired volatility.

We used a Hurst random walk model with $h=.57$, which gave us the best results.

We did not model any drift, because we where interested in predictions over very short time intervals.

Night Moves

Usually there is a substantial difference between one days closing price and the next day's opening price, reflecting the news that occurred in the interim.

The NYSE is open 9:30AM-3:30PM each day. Does more or less activity happen in the 18 hours until the next session?

This can be established by plotting the average daily ratio of night-to-day changes for Dow stocks:



figure=figures/night2day.eps,width=6.0in


The average night-move over this period was 0.567 that of the day-move, with a mean of 0.527.

The impact of these moves can be simulated by running the random walk the equivalent of this many steps each night and starting the next day from there.

Results: Predicting the Expected High

We used our random walk to predict the range of the expected high achieved over the next 1 day and 10 days:



figure=figures/high-1day.eps,width=4in




figure=figures/high-10day.eps,width=4in


The leftmost point records the frequency the actually high never exceeded the close of the start period, with the rightmost point recording the frequency the actually high exceeded our prediction of what is possible in the time period.

The random walks do a good, but not perfect job, of predicting the actual distribution.

We also do a good, but not perfect, job of predicting closing prices:



figure=figures/ourmodel.eps,width=6.0in





next up previous
Next: About this document ... Up: My Home Page
Steve Skiena
2004-03-04