Random Walks & Stochastic Processes
Why is everything so normal?
Most people have heard of the normal distribution, the pdf of this distribution is a Gaussian function, specified by two parameters and :
You can check that using that
an identity which is worth memorizing. Even in times of the internet. The function is bell-shaped with a peak at and an approximate width of .
The shape of the Gaussian (red) and Cauchy (blue) distributions. They look very similar, but are quite different.
Now it’s true that this pdf appears everywhere in science. But why? Why not for example the Cauchy distribution that looks like this
This is also a Bell-shaped curve with a maximum at and and a width that seems to be proportional to . It turns out that this pdf doesn’t have a mean or a variance. But nevertheless, that can’t be the reason why the Gaussian normal distribution is so widespread.
Sums of random variables
Here’s the reason why this is so. Let’s look at set of random numbers with and consider their sum
and let’s say, for the sake of simplicy that all the are independent and drawn from the same distribution which we assume to be even (this assumption isn’t necessary but makes things easier):
For an even pdf the mean is zero, so . Let’s assume that has some width
Other than that, we make no assumptions concerning the shape of the distribution. Now we would like to compute the statistics of . First, the mean has to vanish as well because:
The variance is a bit more tedious to compute:
Here we first split the double sum into a double sum that omits the diagonal () and the sum that captures those elements. Because and are independent if the expectation factorizes. And because the first double some vanishes. What remains is the second diagonal terms that all contribute a . Nice. So the variance increases with .
Now if we interpret the individual as random steps on the axis drawn from the pdf then is the position after steps. The quantity
is the expected distance from the origin after steps. So, a random walk like this one typically is a distance away from the origin after steps. That means I need to wait 4 times longer to move away twice as far.
Now, although we discussed this in one dimension, the above result also holds in any dimension. A random walker that has taken steps is typically a distance away from the original starting point. You can see this in Panel 2 that shows a cloud of random walkers initially at the origin and the root-mean-square of the position as a function of .
The left panel depicts the position of random walkers that all start at the origin. In the right panel their mean distance to the origin is depicted and scales as where is the number of steps.
The left panel depicts the position of random walkers that all start at the origin. In the right panel their mean distance to the origin is depicted and scales as where is the number of steps.
The central limit theorem
There’s more: We can define a new variable
which is just the position devided by the scaling factor . Obviously the pdf for this random variable should depend on the specific functional properties of the pdf of the single steps. However, as we increase the step number the pdf for approaches a Gaussian and looks like this
This is called the central limit theorem. Sloppily, we can say the sum of independent identically distributed random variables will be distributed like a Gaussian. So for the original variable this implies
The central limit theorem is the reason why the Gaussian distribution is so abundant. Whenever we have increments that are independent or random forces that impact a system in one way or another, we can expect the outcome variable to be normally distributed. In a sense all the information and the structure in the statistics of the single steps, so all the functional characteristics in are washed away. Again, this is also true in any dimension. Even if two different random walks, each defined by its own single step pdf, look initially very different, as increases the trajectories of the walks not only appear to look very similar but the statistics of the position always approaches a Gaussian distribution, see the panel below for a geometric interpretation of the central limit theorem in two dimensions.
The central limit theorem: The simulation shows the trajectories of four different random walks that all start at the origin. Each random walk is characterized by a probability distribution for making a single step as illustrated next to the toggles on the right. They are chosen to have identical variance. As the step number increases the geometric differences between the walks disappear and on large scales the walks are no longer distinguishable.
The central limit theorem: The simulation shows the trajectories of four different random walks that all start at the origin. Each random walk is characterized by a probability distribution for making a single step as illustrated next to the toggles on the right. They are chosen to have identical variance. As the step number increases the geometric differences between the walks disappear and on large scales the walks are no longer distinguishable.
Continuous Time
In our interpretation we identified as a temporal variable, the step number. If we now say that
we can perform a continuous time limit. We identify first
and when we look at the variance
we get
The solution to the diffusion equation for and an initially sharply peaked .
We can now let the number of steps and keeping fixed. In this case we also have to decrease the variance of the single steps such that
which yields
and the pdf becomes
where we have made the time dependence explicit in the arguments of the pdf. So this is a Bell curve that spreads out and the width increases as . It’s a good practice to differentiate (we now use the letter for the position) with respect to and twice with respect to because then we find that
which is the diffusion equation. Below, we will derive it in a different way. This equation is very important as it can be used as the foundation for more complex systems in which particles of different types diffuse in space and interact, eventually yielding reaction diffusion systems.
Stochastic differential equations
The Ornstein-Uhlenbeck process
Now let’s look at the 1D dynamical system
This is pretty much the simplest dynamical system we can think of. Physically this might describe a mass on a spring immersed in a viscous liquid like oil that yields an overdamped movement. It will always equilibrate to the stationary state. Let’s aufdrösel this again
So in the small time interval the location changes by . Now let’s assume that in this time interval the mass is exposed to millions, billions and trillions of elastic collisions with small molecules with small mass that transfer energy and momentum to the object and change the position randomly by very very tiny increments . Because of what we said above the pdf for the displacement is distributed like a Gaussian with a certain width and zero mean. The typical size of that displacement is given by
because is the time interval that accumulates all the zillions of little kicks. So we think of the time evolution as
where the is drawn from a normal pdf with a variance of :
Now we can make as small as we want as long as we guarantee that in this small time interval there are very many small kicks happening. Then we get
Note that we avoid deviding by . Some people do that. We don’t. The reason for this is that it makes sense to talk about but not about .
The Ornstein-Uhlenbeck process: This process is governed by one of the simplest Langevin equations: .A linear force is forcing a particle back to the origin, with a force constant . Gaussian noise of strength is driving the particle away from the origin.
The Ornstein-Uhlenbeck process: This process is governed by one of the simplest Langevin equations: .A linear force is forcing a particle back to the origin, with a force constant . Gaussian noise of strength is driving the particle away from the origin.
The process above is known as the Ornstein-Uhlenbeck process. You can explore it in panel above. And the equation above is called a stochastic differential equation specifically a Langevin-equation.
In the Ornstein-Uhlenbeck process, the position variable is driven towards the origin by the linear force term but wiggles around that stable stationary state, driven by the stochastic noise. The larger that noise strength the more wiggle, the stronger the spring constant the smaller the wiggle.
Stationary Ornstein-Uhlenbeck Process
If you start an an ensemble of OUPs at some fixed position, say eventually all trajectories will equilibrate to s stationary distribution around the mean . The variance is given by
so it increases with the noise strength and decreases with the strength of the linear forces. The distribution around the mean is Gaussian
and the autocorrelation function is given by
in equilibrium. Note that the stationary distribution can be writen as
where
is the potential function of the linear force . This is a general result. For example, if we look at…
…the double well potential:
In general a stochastic differential equations often comes in this shape
where the is the deterministic force. Let’s look at this interesting example. First let’s assume that we can compute the potential of the force according to
Let’s say that with a parameter that can be positive or negative. The potential is therefore
Now, if we do an analysis of the deterministic system
we see that this system has either only one stable fixpoint if that becomes unstable if and two additional stable fixpoints emerge, a pitchfork bifurcation. We can now run simulations of the system
to investigate the impact of noise. We find that trajectories, if either concentrate around one or the other stable fixpoint and wiggle around it. Also the stationary distribution will have two peaks, because it is given by
A particle that is trapped in the basin of attraction of one fixpoint can move to the other by the noise that is driving the system. The larger the noise, the more frequent the excursions to the “other side”. This also becomes easier as becomes smaller and smaller, eventually when the system only has one fixpoint at the origin and all trajectories will concentrate there.
Diffusion in a double-well potential.
Diffusion in a double-well potential.
The Wiener Process
What if ? In this case the Then the Langevin equation is particularly simple:
This means we have a process
So we are incrementing in a Gaussian increment every time, like a random walk in continuous time. This also means that at time we have
where is just the result of adding many Gaussian increments
And in analogy to the random walk we have
with a probability density
as we discussed before. The process is known as the Wiener process.
Another road to the diffusion equation
The spreading Gaussian,
as mentioned earlier, fullfills the diffusion equation
Here’s another way of deriving it.
Let’s say we split the line that defines the coordinate into intervals that we interpret as containers at locations and each container having a width . Now let’s assume that there are many particles distributed anywhere on the line. All the particles in the interval belong to that container. We can count the particles in container and denote this numbner by . Because particles can move between containers, we have or equivalently . Now lets’s assume that every particle at can randomly move to the container next door, so to and that means the container at , in a small time interval , may loose particles to the neighboring containers so that
where is a rate constant that quantifies at which rate particles are randomly moving to the neighboring sites. The concentration can also increase due to incoming particles (from the left or the right) so that
So we have
which reads
Now this yields
Now we we let
and perform the limit we get
which again is the diffusion equation. Here, however we derived it not looking at a single randomly moving particle but rather using particle numbers / concentrations.
Random Events - Poisson process
Quite often, in dynamical processes we have a situation in which as time progresses random events occur. For example, let’s say time is at and it advances to a later time where is as small as we like. Now let’s assume that there’s a small probability that in this time interval and event occurs, e.g. a collision of two particles, the birth of an animal, the death of an animal or the firing of neuronal spike. Let’s call this probability
The proportionality constant is called a probability rate. Now let’s assume that every time we advance time by an event can occur. Let’s ask: What is the probability density that an event doesn’t occur for a time and occurs exactly in the time intervale . We can split the time-interval into small segments of duration so . The probability that no event occurs is
multiplied by the probability that the event occurs in which is so
In the limit this becomes
So the probability density for the time-interval between events is an exponential pdf. This process is known as the Poisson process.