Random Number Generators (scipy.stats.sampling)#
This module contains a collection of random number generators to samplefrom univariate continuous and discrete distributions. It uses theimplementation of a C library called “UNU.RAN”. The only exception isRatioUniforms, which is a pure Python implementation of theRatio-of-Uniforms method.
Generators Wrapped#
For continuous distributions#
| Hermite interpolation based INVersion of CDF (HINV). |
| Polynomial interpolation based INVersion of CDF (PINV). |
| Transformed Density Rejection (TDR) Method. |
| Simple Ratio-of-Uniforms (SROU) Method. |
| Generate random samples from a probability density function using the ratio-of-uniforms method. |
For discrete distributions#
| Discrete Alias-Urn Method. |
| Discrete Guide Table method. |
Warnings / Errors used inscipy.stats.sampling#
Raised when an error occurs in the UNU.RAN library. |
Generators for pre-defined distributions#
To easily apply the above methods for some of the continuous distributionsinscipy.stats, the following functionality can be used:
| Fast sampling by numerical inversion of the CDF for a large class of continuous distributions in |