Numerical Simulation of Fokker-Planck Equation

September 11, 2007 by Peyman Khorsand

Here is the list of problems one has to tackle in order to simulate the FP equation.

1) Stability: the finite difference method has to be stable. This can be easily done by using an implicit method.

2) Conservation: the total integral of probability has to be equal to 1. This constraint can be imposed by using probability currents on the right hand side of the FP equation.

3) Positivity: the value of mid point probability can be any combination of two end points of a spatial step. By cleverly using this ambiguity we can insure that probability will never become negative.

Ref to Chang and Cooper for more details.

Polya Problem

August 19, 2007 by Peyman Khorsand

Consider a dynamical system under the influence of random noise. In such a general setting, the Polya problem questions the probability of coming back to the place that the system has started. If the configuration space of the system had finite volume then the probability would have been 1 (in the absence of attractors) somewhat in the same setting as ergodicity.

In the random walk frameworks the problem can be formalized easily. Define Q_n(r) as the probability of reaching to position r for the first time after n-steps. The generating function F(r,z) is defined as

F(r,z) = \sum_{n=1}^{\infty} z^n Q_n(r)

The probability of being as position r after n-steps, p_n(r) is following the consistency equation

p_n(r) = \sum_{j=1}^{n} p_{n-j}(0) Q_j(r)

The above equation relates the generating function for p_n(r) to the Q_n generating function

G(r,z) = \delta_{r,0} + F(r,z) G(0,z)

So the total return probability F(0,1)=Q_1(0)+Q_2(0)+ \ldots can be written as

F(0,1)=1-{1 \over {G(0,1)}}

The generating function G can be related to jump vector distribution, f(r), where p_n(r) = \sum f(r-r^{\prime} ) p_{n-1}(r^{\prime}) through convolution

G(r,z) = {1 \over 2 \pi} \int dk {\exp(-i kr) \over 1 - z{\tilde  f}(k)   }

Random Number Generators

June 8, 2007 by Peyman Khorsand

Generating random numbers is a very challenging task. The result of any algorithm at best will be pseudo-random.

Linear Congruential Generators:

By choosing carefully three integer parameters, A, B and M, we can generate a sequence of random numbers, X_i

X_i= {1 \over M}\left(  A \, X_{i-1} + B   \right) \mod M

One of the shortcoming of such a method is that it has at most a period of order M. In addition, the sequence can be highly correlated. In order to correct these problems we can extend this method to higher dimensions.

Combined Linear Congruential Generators:

A collection of n carefully assigned triplets, A_a, B_a and M_a can be used to build a sequence of random numbers with a period of order $\prod_a M_a$. First we build $n$ parallel sequence of random numbers

x^a_i = \left(  A_a \,  x_{i-1}^a + B_a \right)  \mod M_a

then out of them we build a sequence of random numbers with better quality.

X_i= {1 \over M}\left( \prod_a x^a_i \right) \mod M

were M is defined as \max(M_a). Also a extra shuffling procedure can reduce the correlation in any sequence.

Lagged Fibonacci Generators:

We can use more than one of the previous number in building the next number in the sequence, e.g. X_i = {1\over M} \left( \sum_{k=0}^K A_k X_{i-k} +B \right) \mod M. Finally they don’t need to be even sequential and can lag by any predetermined integers. For the Fibonacci generator to work properly we need a starter generator of other kind to build the first K random number (maximum lag) needed for Fibonacci algorithm.

Ito’s Lemma

May 31, 2007 by Peyman Khorsand

Ito’s lemma can be thought as a generalization of Taylor’s expansion to stochastic processes. Taylor expansion connects the differential of a function F({x}) to d{{x}}.

dF({x}) =  {\partial F \over \partial x } dx + {1\over 2 } {\partial^2 F \over \partial x^2} dx^2 + O(dx^3)

In the same spirit Ito’s lemma connects the differential of a function of a stochastic process F(X_t, t) to dX_t and dt.

dF(X_t, t)= \left( {\partial F \over \partial t} +  {\partial^2 F \over \partial x^2}  \right)dt + \left(\partial F\over \partial x \right) dX_t

This relation can be understood by applying the multiplication rule (dX_t)^2 =dt. The multiplication rule originates from the definition of the Brownian motion.