164
10 Quantum Finance and Path Integrals
we found a new tool—path integrals—at our disposal. They allowed us to solve a
simple problem analytically. But for more complex problems, path integrals turn out
to be very amenable to numerical methods based on Monte-Carlo methods, the topic
of the next section.
10.7 Monte-Carlo Integration
In previous sections, the evaluation of path integrals relies on splitting a long time
interval into many short intervals, introducing spatial coordinates x i at all intermediate times, then using the transition probability from one time slice to the next,
and finally integrating over all intermediate coordinates. This is the rational behind
the first line of (10.65), which also shows that the path integral is essentially a
multi-dimensional integral over the intermediate coordinates with the action S BS in
the exponent being the integrand. Monte-Carlo integration is a powerful method to
evaluate such multi-dimensional integrals.
We start, however, by exploring Monte-Carlo methods for a one-dimensional
example, where we evaluate the numerical value of a Riemann integral of a function
f (x) over an interval a < x < b. The conventional method is based on splitting the
interval into a large number n of sub-divisions dx between equidistant points x i ,
summing up the area of the “bars” with height f (x i ) and width dx and in the end
taking the limit n → ∞. Instead, we can also approximate the integral by simply
generating a large number N of random numbers x j in the interval [a, b], and summing up all values f (x j ). We then have to multiply the sum by an average interval
width, which we estimate to be (b − a)/N . For the Monte-Carlo estimate of the
integral, we therefore find
b
a
f (x)dx ≈
b − a
N
N
j=1
f (x j ) .
(10.70)
If we “roll the dice” a sufficient number of times, thus for large N , we can expect the
approximation to approach the real value of the integral. In order to get an impression
of the rate of convergence as a function of N , we resort to an example: we calculate the
integral of f (x) = 15(x
2
− x
4
)/4 in the interval [−1, 1] by using random numbers
and compare it with the correct value of
1
−1 f (x)dx = 1. The result of the evaluation
is shown in Fig. 10.2. After a few thousand random numbers we approximate the
correct value within the percent level.
The advantage of this method is the simplicity of coding it. Only two lines of
MATLAB suffice
x=-1+2*rand(1,N);
% random numbers between -1 and 1
Imc=(2.0/N)*sum(f(x));
Précédent

- 172/292

Suivant