




























































































Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Esta página não é visível na pré-visualização
Não perca as partes importantes!





























































































Internal Report SUF–PFY/96– Stockholm, 11 December 1996 1st revision, 31 October 1998 last modification 10 September 2007
(e-mail: [email protected])
1 Introduction
In experimental work e.g. in physics one often encounters problems where a standard statistical probability density function is applicable. It is often of great help to be able to handle these in different ways such as calculating probability contents or generating random numbers. For these purposes there are excellent text-books in statistics e.g. the classical work of Maurice G. Kendall and Alan Stuart [1,2] or more modern text-books as [3] and others. Some books are particularly aimed at experimental physics or even specifically at particle physics [4,5,6,7,8]. Concerning numerical methods a valuable references worth mentioning is [9] which has been surpassed by a new edition [10]. Also hand-books, especially [11], has been of great help throughout. However, when it comes to actual applications it often turns out to be hard to find de- tailed explanations in the literature ready for implementation. This work has been collected over many years in parallel with actual experimental work. In this way some material may be “historical” and sometimes be na¨ıve and have somewhat clumsy solutions not always made in the mathematically most stringent may. We apologize for this but still hope that it will be of interest and help for people who is struggling to find methods to solve their statistical problems in making real applications and not only learning statistics as a course. Even if one has the skill and may be able to find solutions it seems worthwhile to have easy and fast access to formulæ ready for application. Similar books and reports exist e.g. [12,13] but we hope the present work may compete in describing more distributions, being more complete, and including more explanations on relations given.
The material could most probably have been divided in a more logical way but we have chosen to present the distributions in alphabetic order. In this way it is more of a hand-book than a proper text-book.
After the first release the report has been modestly changed. Minor changes to cor- rect misprints is made whenever found. In a few cases subsections and tables have been added. These alterations are described on page 182. In October 1998 the first somewhat bigger revision was made where in particular a lot of material on the non-central sampling distributions were added.
In modern computing Monte Carlo simulations are of vital importance and we give meth- ods to achieve random numbers from the distributions. An earlier report dealt entirely with these matters [14]. Not all text-books on statistics include information on this subject which we find extremely useful. Large simulations are common in particle physics as well as in other areas but often it is also useful to make small “toy Monte Carlo programs” to inves- tigate and study analysis tools developed on ideal, but statistically sound, random samples.
A related and important field which we will only mention briefly here, is how to get good basic generators for achieving random numbers uniformly distributed between zero and one. Those are the basis for all the methods described in order to get random numbers
from specific distributions in this document. For a review see e.g. [15]. From older methods often using so called multiplicative congruential method or shift- generators G. Marsaglia et al [16] introduced in 1989 a new “universal generator” which became the new standard in many fields. We implemented this in our experiments at CERN and also made a package of routines for general use [17]. This method is still a very good choice but later alternatives, claimed to be even better, have turned up. These are based on on the same type of lagged Fibonacci sequences as is used in the universal generator and was originally proposed by the same authors [18]. An implementations of this method was proposed by F. James [15] and this version was further developed by M. L¨uscher [19]. A similar package of routine as was prepared for the universal generator has been implemented for this method [20].
2.2.1 Errors of Moments
For a thorough presentation of how to estimate errors on moments we refer to the classical books by M. G. Kendall and A. Stuart [1] (pp 228–245). Below only a brief description is given. For a sample with n observations x 1 , x 2 ,... , xn we define the moment-statistics for the algebraic and central moments m′ r and mr as
m′ r =
n
∑^ n r=
xr^ and mr =
n
∑^ n r=
(x − m′ 1 ) r
The notation m′ r and mr are thus used for the statistics (sample values) while we denote the true, population, values by μ′ r and μr. The mean value of the r:th and the sampling covariance between the q:th and r:th moment-statistic are given by.
E(m′ r) = μ′ r
Cov(m′ q, m′ r) =
n
( μ′ q+r − μ′ qμ′ r
)
These formula are exact. Formulæ for moments about the mean are not as simple since the mean itself is subject to sampling fluctuations.
E(mr) = μr
Cov(mq, mr) =
n
(μq+r − μqμr + rqμ 2 μr− 1 μq− 1 − rμr− 1 μq+1 − qμr+1μq− 1 )
to order 1/
n and 1/n, respectively. The covariance between an algebraic and a central moment is given by
Cov(mr, m′ q) =
n
(μq+r − μqμr − rμq+1μr− 1 )
to order 1/n. Note especially that
V (m′ r) =
n
( μ′ 2 r − μ′ r^2
)
V (mr) =
n
( μ 2 r − μ^2 r + r^2 μ 2 μ^2 r− 1 − 2 rμr− 1 μr+
)
Cov(m′ 1 , mr) =
n
(μr+1 − rμ 2 μr− 1 )
For a distribution in a continuous variable x the Fourier transform of the probability density function
φ(t) = E(eıxt) =
∫^ ∞
−∞
eıxtf (x)dx
is called the characteristic function. It has the properties that φ(0) = 1 and |φ(t)| ≤ 1 for all t. If the cumulative, distribution, function F (x) is continuous everywhere and dF (x) = f (x)dx then we reverse the transform such that
f (x) =
2 π
∫^ ∞
−∞
φ(t)e−ıxtdt
The characteristic function is related to the moments of the distribution by
φx(t) = E(eıtx) =
∑^ ∞
n=
(ıt)nE(xn) n!
∑^ ∞
n=
(ıt)nμ′ n n!
e.g. algebraic moments may be found by
μ′ r =
ır
( d dt
)r φ(t)
∣∣ ∣∣ ∣t=
To find central moments (about the mean μ) use
φx−μ(t) = E
( eıt(x−μ)
) = e−ıtμφx(t)
and thus
μr =
ır
( d dt
)r e−ıtμφ(t)
∣∣ ∣∣ ∣t=
A very useful property of the characteristic function is that for independent variables x and y φx+y(t) = φx(t) · φy(t)
As an example regard the sum
∑ aizi where the zi’s are distributed according to normal distributions with means μi and variances σ^2 i. Then the linear combination will also be distributed according to the normal distribution with mean
∑ aiμi and variance
∑ a^2 i σ i^2. To show that the characteristic function in two variables factorizes is the best way to show independence between two variables. Remember that a vanishing correlation coeffi- cient does not imply independence while the reversed is true.
In the case of a distribution in a discrete variable r the characteristic function is given by
φ(t) = E(eıtr) =
∑ p(r)eıtr
In this case it is often convenient to write z = eıt^ and define the probability generating function as G(z) = E(zr) =
∑ p(r)zr
κ 1 = μ′ 1 κ 2 = μ 2 μ 2 = κ 2 κ 3 = μ 3 μ 3 = κ 3 κ 4 = μ 4 − 3 μ^22 μ 4 = κ 4 + 3κ^22 κ 5 = μ 5 − 10 μ 3 μ 2 μ 5 = κ 5 + 10κ 3 κ 2 κ 6 = μ 6 − 15 μ 4 μ 2 − 10 μ^23 + 30μ^32 μ 6 = κ 6 + 15κ 4 κ 2 + 10κ^23 + 15κ^32 κ 7 = μ 7 − 21 μ 5 μ 2 − 35 μ 4 μ 3 + 210μ 3 μ^22 μ 7 = κ 7 + 21κ 5 κ 2 + 35κ 4 κ 3 + 105κ 3 κ^22 κ 8 = μ 8 − 28 μ 6 μ 2 − 56 μ 5 μ 3 − 35 μ^24 + μ 8 = κ 8 + 28κ 6 κ 2 + 56κ 5 κ 3 + 35κ^24 + +420μ 4 μ^22 + 560μ^23 μ 2 − 630 μ^42 +210κ 4 κ^22 + 280κ^23 κ 2 + 105κ^42
When generating random numbers from different distribution it is assumed that a good generator for uniform pseudorandom numbers between zero and one exist (normally the end-points are excluded).
2.6.1 Cumulative Technique
The most direct technique to obtain random numbers from a continuous probability density function f (x) with a limited range from xmin to xmax is to solve for x in the equation
ξ =
F (x) − F (xmin) F (xmax) − F (xmin)
where ξ is uniformly distributed between zero and one and F (x) is the cumulative dis- tribution (or as statisticians say the distribution function). For a properly normalized probability density function thus x = F −^1 (ξ) The technique is sometimes also of use in the discrete case if the cumulative sum may be expressed in analytical form as e.g. for the geometric distribution. Also for general cases, discrete or continuous, e.g. from an arbitrary histogram the cumulative method is convenient and often faster than more elaborate methods. In this case the task is to construct a cumulative vector and assign a random number according to the value of a uniform random number (interpolating within bins in the continuous case).
2.6.2 Accept-Reject technique
A useful technique is the acceptance-rejection, or hit-miss, method where we choose fmax to be greater than or equal to f (x) in the entire interval between xmin and xmax and proceed as follows
i Generate a pair of uniform pseudorandom numbers ξ 1 and ξ 2.
ii Determine x = xmin + ξ 1 · (xmax − xmin).
iii Determine y = fmax · ξ 2.
iv If y − f (x) > 0 reject and go to i else accept x as a pseudorandom number from f (x).
The efficiency of this method depends on the average value of f (x)/fmax over the in- terval. If this value is close to one the method is efficient. On the other hand, if this average is close to zero, the method is extremely inefficient. If α is the fraction of the area fmax · (xmax − xmin) covered by the function the average number of rejects in step iv is (^1) α − 1 and (^2) α uniform pseudorandom numbers are required on average.
The efficiency of this method can be increased if we are able to choose a function h(x), from which random numbers are more easily obtained, such that f (x) ≤ αh(x) = g(x) over the entire interval under consideration (where α is a constant). A random sample from f (x) is obtained by
i Generate in x a random number from h(x).
ii Generate a uniform random number ξ.
iii If ξ ≥ f (x)/g(x) go back to i else accept x as a pseudorandom number from f (x).
Yet another situation is when a function g(x), from which fast generation may be obtained, can be inscribed in such a way that a big proportion (f ) of the area under the function is covered (as an example see the trapezoidal method for the normal distribution). Then proceed as follows:
i Generate a uniform random number ξ.
ii If ξ < f then generate a random number from g(x).
iii Else use the acceptance/rejection technique for h(x) = f (x) − g(x) (in subintervals if more efficient).
2.6.3 Composition Techniques
If f (x) may be written in the form
f (x) =
∫^ ∞
−∞
gz (x)dH(z)
where we know how to sample random numbers from the p.d.f. g(x) and the distribution function H(z). A random number from f (x) is then obtained by
i Generate two uniform random numbers ξ 1 and ξ 2.
ii Determine z = H−^1 (ξ 1 ).
iii Determine x = G− z 1 (ξ 2 ) where Gz is the distribution function corresponding to the p.d.f. gz (x).
For more detailed information on the Composition technique see [21] or [22].