This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 34. Monte Carlo techniques 1 34. MONTE CARLO TECHNIQUES Revised September 2009 by G. Cowan (RHUL). Monte Carlo techniques are often the only practical way to evaluate dicult integrals or to sample random variables governed by complicated probability density functions. Here we describe an assortment of methods for sampling some commonly occurring probability density functions. 34.1. Sampling the uniform distribution Most Monte Carlo sampling or integration techniques assume a random number generator, which generates uniform statistically independent values on the half open interval [0 , 1); for reviews see, e.g. ,[1, 2]. Uniform random number generators are available in software libraries such as CERNLIB [3], CLHEP [4], and ROOT [5]. For example, in addition to a basic congruential generator TRandom (see below), ROOT provides three more sophisticated routines: TRandom1 implements the RANLUX generator [6] based on the method by Luscher, and allows the user to select different quality levels, trading off quality with speed; TRandom2 is based on the maximally equidistributed combined Tausworthe generator by LEcuyer [7]; the TRandom3 generator implements the Mersenne twister algorithm of Matsumoto and Nishimura [8]. All of the algorithms produce a periodic sequence of numbers, and to obtain effectively random values, one must not use more than a small subset of a single period. The Mersenne twister algorithm has an extremely long period of 2 19937 1. The performance of the generators can be investigated with tests such as DIEHARD [9] or TestU01 [10]. Many commonly available congruential generators fail these tests and often have sequences (typically with periods less than 2 32 ), which can be easily exhausted on modern computers. A short period is a problem for the TRandom generator in ROOT, which, however, has the advantage that its state is stored in a single 32bit word. The generators TRandom1 , TRandom2 , or TRandom3 have much longer periods, with TRandom3 being recommended by the ROOT authors as providing the best combination of speed and good random properties. 34.2. Inverse transform method If the desired probability density function is f ( x ) on the range < x < , its cumulative distribution function (expressing the probability that x a ) is given by Eq. (32 . 6). If a is chosen with probability density f ( a ), then the integrated probability up to point a , F ( a ), is itself a random variable which will occur with uniform probability density on [0 , 1]. If x can take on any value, and ignoring the endpoints, we can then find a unique x chosen from the p.d.f. f ( s ) for a given u if we set u = F ( x ) , (34 . 1) provided we can find an inverse of F , defined by x = F 1 ( u ) . (34 . 2) K. Nakamura et al. , JPG 37 , 075021 (2010) (http://pdg.lbl.gov) July 30, 2010 14:36 2 34. Monte Carlo techniques This method is shown in Fig. 34.1a. It is most convenient when one can calculate by hand the inverse function of the indefinite integral of...
View
Full
Document
 Spring '11
 Kutter

Click to edit the document details