A random walk is a sequence of random variables X_{0}, X_{1}, X_{2}, . . . such that the successive differences J_{n} = X_{n}-X_{n-1} form a sequence of independent, identically distributed random variables.
If the distribution of the J_{n} takes the form
P(J_{n} = +1) = p, P(J_{n} = -1) = q = 1-p, |
Three random walks | |
---|---|
The blue process is a simple symmetric random walk (p=q=½) The magenta process is a SRW with downward drift (q=2p). The red process is a SRW with downward drift (q=2p), with a reflecting barrier at 0. In this instance the same sequence of pseudo-random numbers has been used to generate all three processes: observe that the two walks with downward drift make identical transitions, except when the red one is at zero. |
Example: binomial lattice model for share prices
Notice that this structure implies that X_{n}-X_{0} is a sum of i.i.d. random variables, so that we can apply a number of general results. Among these is the Central Limit Theorem:
(X_{n}-X_{0}) - n(p-q) Ö(4npq) | ® N(0,1). |
as n®¥. We can use this to show that, if p > q, then
P(X_{n} < 0 | X_{0} = 0) ® 0 |
and that a similar result holds when p < q.
If p = q = ½ we have a simple symmetric random walk. The CLT tells us nothing useful in this case.
The Weak Law of Large Numbers states that, as n ® ¥
P(-c < | X_{n} - X_{0} n | - (p - q) < c) ® 1 |
for any c>0. In the case of the SSRW this tells us no more than the Central Limit Theorem. We still know nothing about the path taken by the random walk, only about where it might be at a specific time n.
(The Strong Law of Large Numbers gives additional information, stating that the sequence {(X_{n} - X_{0})/n} is convergent with probability 1.)
The CLT only deals in general tendencies.
Consider
h_{k} = P(X ever hits 0 | X_{0}=k),
where k > 0.
We can obtain an equation for h_{k} in terms of
h_{k+1}
and h_{k-1} by looking at the first step:
for k > 1,
h_{k} = p h_{k+1} + q h_{k-1} |
(Careful with k=1.)
Difference equation theory gives the solution, h_{k} = A + B(q/p)^{k}, for some A and B. Imposing a barrier at k=K, a very large number, gives a solution for A and B, which can be extended to the case k=¥.
An absorbing barrier for a random walk is a value c such that, if X_{n}=c for some n_{0}, then X_{n}=c for all n>n_{0}. In other words, if the random walk hits the barrier it becomes stuck there.
An upwards reflecting barrier is a value c such that, if X_{n}=c, then X_{n+1}=c+1. (Downwards similarly.)
A random walk with two absorbing barriers is certain to hit one or other of them in the end. If there is one absorbing barrier and one reflecting one, the random walk will always get to the absorbing barrier.
Many models are based on the simple random walk. Random walks may be used for minor elements of complex models. The process of fitting and testing a random walk model is the same in all cases.
Assume, then, that we have a sequence of observations x_{1}, …, x_{n}.
First decide whether the raw process needs a transformation.
A standard method is to investigate whether the increment
x_{n+1} - x_{n}
depends on x_{n}.
A plot should do.
A typical transformation is the log-transform.
Next decide if you want to use a discrete state-space model.
If so, the data will need to be adjusted to a grid, by rounding off
every observation to the nearest multiple of the mesh size,
d.
Let y_{1}, …, y_{n} be the observations after possible transformation and discretisation, and define j_{m} = y_{m} - y_{m-1}.
Under a random walk model these should all be i.i.d., so we can plot histograms to choose a distribution (unless already specified), then use standard parameter estimation procedures.
Test to ensure that the distribution, with estimated parameter values, fits the increment data (goodness of fit test).
Run a few simulations to see whether they look like the real thing.
Once we can simulate a sequence of i.i.d. variables from the required distribution, it is easy to simulate the random walk. See the first lab session.