Docsity

Distributions Handbook, Manuais, Projetos, Pesquisas de Informática

Pré-visualização parcial do texto

Baixe Distributions Handbook e outras Manuais, Projetos, Pesquisas em PDF para Informática, somente na Docsity!

Internal Report SUF–PFY/96– Stockholm, 11 December 1996 1st revision, 31 October 1998 last modification 10 September 2007

Hand-book on

STATISTICAL

DISTRIBUTIONS

for

experimentalists

by

Christian Walck

Particle Physics Group

Fysikum

University of Stockholm

(e-mail: [email protected])

  • 1 Introduction
    • 1.1 Random Number Generation
  • 2 Probability Density Functions
    • 2.1 Introduction
    • 2.2 Moments
      • 2.2.1 Errors of Moments
    • 2.3 Characteristic Function
    • 2.4 Probability Generating Function
    • 2.5 Cumulants
    • 2.6 Random Number Generation
      • 2.6.1 Cumulative Technique
      • 2.6.2 Accept-Reject technique
      • 2.6.3 Composition Techniques
    • 2.7 Multivariate Distributions
      • 2.7.1 Multivariate Moments
      • 2.7.2 Errors of Bivariate Moments
      • 2.7.3 Joint Characteristic Function
      • 2.7.4 Random Number Generation
  • 3 Bernoulli Distribution
    • 3.1 Introduction
    • 3.2 Relation to Other Distributions
  • 4 Beta distribution
    • 4.1 Introduction
    • 4.2 Derivation of the Beta Distribution
    • 4.3 Characteristic Function
    • 4.4 Moments
    • 4.5 Probability Content
    • 4.6 Random Number Generation
  • 5 Binomial Distribution
    • 5.1 Introduction
    • 5.2 Moments
    • 5.3 Probability Generating Function
    • 5.4 Cumulative Function
    • 5.5 Random Number Generation
    • 5.6 Estimation of Parameters
    • 5.7 Probability Content
  • 6 Binormal Distribution
    • 6.1 Introduction
    • 6.2 Conditional Probability Density
    • 6.3 Characteristic Function
    • 6.4 Moments
    • 6.5 Box-Muller Transformation
    • 6.6 Probability Content
    • 6.7 Random Number Generation
  • 7 Cauchy Distribution
    • 7.1 Introduction
    • 7.2 Moments
    • 7.3 Normalization
    • 7.4 Characteristic Function
    • 7.5 Location and Scale Parameters
    • 7.6 Breit-Wigner Distribution
    • 7.7 Comparison to Other Distributions
    • 7.8 Truncation
    • 7.9 Sum and Average of Cauchy Variables
    • 7.10 Estimation of the Median
    • 7.11 Estimation of the HWHM
    • 7.12 Random Number Generation
    • 7.13 Physical Picture
    • 7.14 Ratio Between Two Standard Normal Variables
  • 8 Chi-square Distribution
    • 8.1 Introduction
    • 8.2 Moments
    • 8.3 Characteristic Function
    • 8.4 Cumulative Function
    • 8.5 Origin of the Chi-square Distribution
    • 8.6 Approximations
    • 8.7 Random Number Generation
    • 8.8 Confidence Intervals for the Variance
    • 8.9 Hypothesis Testing
    • 8.10 Probability Content
    • 8.11 Even Number of Degrees of Freedom
    • 8.12 Odd Number of Degrees of Freedom
    • 8.13 Final Algorithm
    • 8.14 Chi Distribution
  • 9 Compound Poisson Distribution
    • 9.1 Introduction
    • 9.2 Branching Process
    • 9.3 Moments
    • 9.4 Probability Generating Function
    • 9.5 Random Number Generation
  • 10 Double-Exponential Distribution
    • 10.1 Introduction
    • 10.2 Moments
    • 10.3 Characteristic Function
    • 10.4 Cumulative Function
    • 10.5 Random Number Generation
  • 11 Doubly Non-Central F -Distribution
    • 11.1 Introduction
    • 11.2 Moments
    • 11.3 Cumulative Distribution
    • 11.4 Random Number Generation
  • 12 Doubly Non-Central t-Distribution
    • 12.1 Introduction
    • 12.2 Moments
    • 12.3 Cumulative Distribution
    • 12.4 Random Number Generation
  • 13 Error Function
    • 13.1 Introduction
    • 13.2 Probability Density Function
  • 14 Exponential Distribution
    • 14.1 Introduction
    • 14.2 Cumulative Function
    • 14.3 Moments
    • 14.4 Characteristic Function
    • 14.5 Random Number Generation
      • 14.5.1 Method by von Neumann
      • 14.5.2 Method by Marsaglia
      • 14.5.3 Method by Ahrens
  • 15 Extreme Value Distribution
    • 15.1 Introduction
    • 15.2 Cumulative Distribution
    • 15.3 Characteristic Function
    • 15.4 Moments
    • 15.5 Random Number Generation
  • 16 F-distribution
    • 16.1 Introduction
    • 16.2 Relations to Other Distributions
    • 16.3 1/F
    • 16.4 Characteristic Function
    • 16.5 Moments
    • 16.6 F-ratio
    • 16.7 Variance Ratio
    • 16.8 Analysis of Variance
    • 16.9 Calculation of Probability Content
      • 16.9.1 The Incomplete Beta function
      • 16.9.2 Final Formulæ
    • 16.10 Random Number Generation
  • 17 Gamma Distribution
    • 17.1 Introduction
    • 17.2 Derivation of the Gamma Distribution
    • 17.3 Moments
    • 17.4 Characteristic Function
    • 17.5 Probability Content
    • 17.6 Random Number Generation
      • 17.6.1 Erlangian distribution
      • 17.6.2 General case
      • 17.6.3 Asymptotic Approximation
  • 18 Generalized Gamma Distribution
    • 18.1 Introduction
    • 18.2 Cumulative Function
    • 18.3 Moments
    • 18.4 Relation to Other Distributions
  • 19 Geometric Distribution
    • 19.1 Introduction
    • 19.2 Moments
    • 19.3 Probability Generating Function
    • 19.4 Random Number Generation
  • 20 Hyperexponential Distribution
    • 20.1 Introduction
    • 20.2 Moments
    • 20.3 Characteristic Function
    • 20.4 Random Number Generation
  • 21 Hypergeometric Distribution
    • 21.1 Introduction
    • 21.2 Probability Generating Function
    • 21.3 Moments
    • 21.4 Random Number Generation
  • 22 Logarithmic Distribution
    • 22.1 Introduction
    • 22.2 Moments
    • 22.3 Probability Generating Function
    • 22.4 Random Number Generation
  • 23 Logistic Distribution
    • 23.1 Introduction
    • 23.2 Cumulative Distribution
    • 23.3 Characteristic Function
    • 23.4 Moments
    • 23.5 Random numbers
  • 24 Log-normal Distribution
    • 24.1 Introduction
    • 24.2 Moments
    • 24.3 Cumulative Distribution
    • 24.4 Random Number Generation
  • 25 Maxwell Distribution
    • 25.1 Introduction
    • 25.2 Moments
    • 25.3 Cumulative Distribution
    • 25.4 Kinetic Theory
    • 25.5 Random Number Generation
  • 26 Moyal Distribution
    • 26.1 Introduction
    • 26.2 Normalization
    • 26.3 Characteristic Function
    • 26.4 Moments
    • 26.5 Cumulative Distribution
    • 26.6 Random Number Generation
  • 27 Multinomial Distribution
    • 27.1 Introduction
    • 27.2 Histogram
    • 27.3 Moments
    • 27.4 Probability Generating Function
    • 27.5 Random Number Generation
    • 27.6 Significance Levels
    • 27.7 Equal Group Probabilities
  • 28 Multinormal Distribution
    • 28.1 Introduction
    • 28.2 Conditional Probability Density
    • 28.3 Probability Content
    • 28.4 Random Number Generation
  • 29 Negative Binomial Distribution
    • 29.1 Introduction
    • 29.2 Moments
    • 29.3 Probability Generating Function
    • 29.4 Relations to Other Distributions
      • 29.4.1 Poisson Distribution
      • 29.4.2 Gamma Distribution
      • 29.4.3 Logarithmic Distribution
      • 29.4.4 Branching Process
      • 29.4.5 Poisson and Gamma Distributions
    • 29.5 Random Number Generation
  • 30 Non-central Beta-distribution
    • 30.1 Introduction
    • 30.2 Derivation of distribution
    • 30.3 Moments
    • 30.4 Cumulative distribution
    • 30.5 Random Number Generation
  • 31 Non-central Chi-square Distribution
    • 31.1 Introduction
    • 31.2 Characteristic Function
    • 31.3 Moments
    • 31.4 Cumulative Distribution
    • 31.5 Approximations
    • 31.6 Random Number Generation
  • 32 Non-central F -Distribution
    • 32.1 Introduction
    • 32.2 Moments
    • 32.3 Cumulative Distribution
    • 32.4 Approximations
    • 32.5 Random Number Generation
  • 33 Non-central t-Distribution
    • 33.1 Introduction
    • 33.2 Derivation of distribution
    • 33.3 Moments
    • 33.4 Cumulative Distribution
    • 33.5 Approximation
    • 33.6 Random Number Generation
  • 34 Normal Distribution
    • 34.1 Introduction
    • 34.2 Moments
    • 34.3 Cumulative Function
    • 34.4 Characteristic Function
    • 34.5 Addition Theorem
    • 34.6 Independence of x and s
    • 34.7 Probability Content
    • 34.8 Random Number Generation
      • 34.8.1 Central Limit Theory Approach
      • 34.8.2 Exact Transformation
      • 34.8.3 Polar Method
      • 34.8.4 Trapezoidal Method
      • 34.8.5 Center-tail method
      • 34.8.6 Composition-rejection Methods
      • 34.8.7 Method by Marsaglia
      • 34.8.8 Histogram Technique
      • 34.8.9 Ratio of Uniform Deviates
      • 34.8.10 Comparison of random number generators
    • 34.9 Tests on Parameters of a Normal Distribution
  • 35 Pareto Distribution
    • 35.1 Introduction
    • 35.2 Cumulative Distribution
    • 35.3 Moments
    • 35.4 Random Numbers
  • 36 Poisson Distribution
    • 36.1 Introduction
    • 36.2 Moments
    • 36.3 Probability Generating Function
    • 36.4 Cumulative Distribution
    • 36.5 Addition Theorem
    • 36.6 Derivation of the Poisson Distribution
    • 36.7 Histogram
    • 36.8 Random Number Generation
  • 37 Rayleigh Distribution
    • 37.1 Introduction
    • 37.2 Moments
    • 37.3 Cumulative Distribution
    • 37.4 Two-dimensional Kinetic Theory
    • 37.5 Random Number Generation
  • 38 Student’s t-distribution
    • 38.1 Introduction
    • 38.2 History
    • 38.3 Moments
    • 38.4 Cumulative Function
    • 38.5 Relations to Other Distributions
    • 38.6 t-ratio
    • 38.7 One Normal Sample
    • 38.8 Two Normal Samples
    • 38.9 Paired Data
    • 38.10 Confidence Levels
    • 38.11 Testing Hypotheses
    • 38.12 Calculation of Probability Content
      • 38.12.1 Even number of degrees of freedom
      • 38.12.2 Odd number of degrees of freedom
      • 38.12.3 Final algorithm
    • 38.13 Random Number Generation
  • 39 Triangular Distribution
    • 39.1 Introduction
    • 39.2 Moments
    • 39.3 Random Number Generation
  • 40 Uniform Distribution - 40.1 Introduction - 40.2 Moments - 40.3 Random Number Generation
  • 41 Weibull Distribution - 41.1 Introduction - 41.2 Cumulative Distribution - 41.3 Moments - 41.4 Random Number Generation
  • 42 Appendix A: The Gamma and Beta Functions - 42.1 Introduction - 42.2 The Gamma Function - 42.2.1 Numerical Calculation - 42.2.2 Formulæ - 42.3 Digamma Function - 42.4 Polygamma Function - 42.5 The Incomplete Gamma Function - 42.5.1 Numerical Calculation - 42.5.2 Formulæ - 42.5.3 Special Cases - 42.6 The Beta Function - 42.7 The Incomplete Beta Function - 42.7.1 Numerical Calculation - 42.7.2 Approximation - 42.8 Relations to Probability Density Functions - 42.8.1 The Beta Distribution - 42.8.2 The Binomial Distribution - 42.8.3 The Chi-squared Distribution - 42.8.4 The F -distribution - 42.8.5 The Gamma Distribution - 42.8.6 The Negative Binomial Distribution - 42.8.7 The Normal Distribution - 42.8.8 The Poisson Distribution - 42.8.9 Student’s t-distribution - 42.8.10 Summary
  • 43 Appendix B: Hypergeometric Functions - 43.1 Introduction - 43.2 Hypergeometric Function - 43.3 Confluent Hypergeometric Function
    • Mathematical Constants
    • Errata et Addenda
  • References
  • Index
    • 1 Percentage points of the chi-square distribution List of Tables
    • 2 Extreme confidence levels for the chi-square distribution
    • 3 Extreme confidence levels for the chi-square distribution (as χ^2 /d.f. values)
    • 4 Exact and approximate values for the Bernoulli numbers
    • 5 Percentage points of the F -distribution
    • 6 Probability content from −z to z of Gauss distribution in %
    • 7 Standard normal distribution z-values for a specific probability content
    • 8 Percentage points of the t-distribution
    • 9 Expressions for the Beta function B(m, n) for integer and half-integer arguments

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.

1.1 Random Number Generation

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 )

2.3 Characteristic Function

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.

2.4 Probability Generating Function

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

2.6 Random Number Generation

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].