Next: Status of this document
Up: Introduction
Previous: Status of this document
Contents
Monte Carlo Methods
The Geant4 toolkit uses a combination of the composition and
rejection Monte Carlo methods. Only the basic formalism of these methods is
outlined here. For a complete account of the Monte Carlo methods, the
interested user is referred to the publications of Butcher and Messel,
Messel and Crawford, or Ford and Nelson [#!m.butch!#,#!m.messel!#,#!m.egs4!#].
Suppose we wish to sample in the interval
from the
distribution and the normalised probability density function can
be written as :
|
(2.1) |
where , are normalised density functions on
, and
.
According to this method, can sampled in the following way:
- select a random integer
with probability proportional to
- select a value from the distribution
- calculate and accept with probability ;
- if is rejected restart from step 1.
It can be shown that this scheme is correct and the mean
number of tries to accept a value is
.
In practice, a good method of sampling from the distribution has the
following properties:
- all the subdistributions can be sampled easily;
- the rejection functions can be evaluated easily/quickly;
- the mean number of tries is not too large.
Thus the different possible decompositions of the distribution
are not equivalent from the practical point of view (e.g. they
can be very different in computational speed) and it can be useful
to optimise the decomposition.
A remark of practical importance : if our distribution is not
normalised
the method can be used in the same
manner; the mean number of tries in this
case is
.
Subsections
Next: Status of this document
Up: Introduction
Previous: Status of this document
Contents