GSL(GNU Scientific Library)参考手册/随机数分布

跳到导航 跳到搜索



本章描述的函数用于生成随机变量并计算它们的概率分布。 Samples from the distributions described in this chapter can be obtained using any of the random number generators in the library as an underlying source of randomness.

In the simplest cases a non-uniform distribution can be obtained analytically from the uniform distribution of a random number generator by applying an appropriate transformation. This method uses one call to the random number generator. More complicated distributions are created by the acceptance-rejection method, which compares the desired distribution against a distribution which is similar and known analytically. This usually requires several samples from the generator.

The library also provides cumulative distribution functions and inverse cumulative distribution functions, sometimes referred to as quantile functions. The cumulative distribution functions and their inverses are computed separately for the upper and lower tails of the distribution, allowing full accuracy to be retained for small results.

The functions for random variates and probability density functions described in this section are declared in gsl_randist.h. The corresponding cumulative distribution functions are declared in gsl_cdf.h.

Note that the discrete random variate functions always return a value of type unsigned int, and on most platforms this has a maximum value of 2^32-1 ~=~ 4.29e9. They should only be called with a safe range of parameters (where there is a negligible probability of a variate exceeding this limit) to prevent incorrect results due to overflow.

• Random Number Distribution Introduction:

• The Gaussian Distribution:

• The Gaussian Tail Distribution:

• The Bivariate Gaussian Distribution:

• The Exponential Distribution:

• The Laplace Distribution:

• The Exponential Power Distribution:

• The Cauchy Distribution:

• The Rayleigh Distribution:

• The Rayleigh Tail Distribution:

• The Landau Distribution:

• The Levy alpha-Stable Distributions:

• The Levy skew alpha-Stable Distribution:

• The Gamma Distribution:

• The Flat (Uniform) Distribution:

• The Lognormal Distribution:

• The Chi-squared Distribution:

• The F-distribution:

• The t-distribution:

• The Beta Distribution:

• The Logistic Distribution:

• The Pareto Distribution:

• Spherical Vector Distributions:

• The Weibull Distribution:

• The Type-1 Gumbel Distribution:

• The Type-2 Gumbel Distribution:

• The Dirichlet Distribution:

• General Discrete Distributions:

• The Poisson Distribution:

• The Bernoulli Distribution:

• The Binomial Distribution:

• The Multinomial Distribution:

• The Negative Binomial Distribution:

• The Pascal Distribution:

• The Geometric Distribution:

• The Hypergeometric Distribution:

• The Logarithmic Distribution:

• Shuffling and Sampling:

• Random Number Distribution Examples:

• Random Number Distribution References and Further Reading: