The Logarithmic Distribution - GNU Scientific Library -- Reference Manual
Description: GNU Scientific Library -- Reference Manual

Next: Shuffling and Sampling, Previous: The Hypergeometric Distribution, Up: Random Number Distributions

### 20.37 The Logarithmic Distribution

— Function: unsigned int gsl_ran_logarithmic (const gsl_rng * r, double p)

> This function returns a random integer from the logarithmic distribution. The probability distribution for logarithmic random variates is,

>               p(k) = {-1 \over \log(1-p)} {(p^k \over k)}

> for k >= 1.

— Function: double gsl_ran_logarithmic_pdf (unsigned int k, double p)

> This function computes the probability p(k) of obtaining k from a logarithmic distribution with probability parameter p, using the formula given above.

The GNU Scientific Library - a free numerical library licensed under the GNU GPL
Back to the GNU Scientific Library Homepage