sampling.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. """
  2. ======================================================
  3. Random Number Generators (:mod:`scipy.stats.sampling`)
  4. ======================================================
  5. .. currentmodule:: scipy.stats.sampling
  6. This module contains a collection of random number generators to sample
  7. from univariate continuous and discrete distributions. It uses the
  8. implementation of a C library called "UNU.RAN". The only exception is
  9. RatioUniforms, which is a pure Python implementation of the
  10. Ratio-of-Uniforms method.
  11. Generators Wrapped
  12. ==================
  13. For continuous distributions
  14. ----------------------------
  15. .. autosummary::
  16. :toctree: generated/
  17. NumericalInverseHermite
  18. NumericalInversePolynomial
  19. TransformedDensityRejection
  20. SimpleRatioUniforms
  21. RatioUniforms
  22. For discrete distributions
  23. --------------------------
  24. .. autosummary::
  25. :toctree: generated/
  26. DiscreteAliasUrn
  27. DiscreteGuideTable
  28. Warnings / Errors used in :mod:`scipy.stats.sampling`
  29. -----------------------------------------------------
  30. .. autosummary::
  31. :toctree: generated/
  32. UNURANError
  33. Generators for pre-defined distributions
  34. ========================================
  35. To easily apply the above methods for some of the continuous distributions
  36. in :mod:`scipy.stats`, the following functionality can be used:
  37. .. autosummary::
  38. :toctree: generated/
  39. FastGeneratorInversion
  40. """
  41. from ._sampling import FastGeneratorInversion, RatioUniforms # noqa: F401
  42. from ._unuran.unuran_wrapper import ( # noqa: F401
  43. TransformedDensityRejection,
  44. DiscreteAliasUrn,
  45. DiscreteGuideTable,
  46. NumericalInversePolynomial,
  47. NumericalInverseHermite,
  48. SimpleRatioUniforms,
  49. UNURANError
  50. )
  51. __all__ = ["NumericalInverseHermite", "NumericalInversePolynomial",
  52. "TransformedDensityRejection", "SimpleRatioUniforms",
  53. "RatioUniforms", "DiscreteAliasUrn", "DiscreteGuideTable",
  54. "UNURANError", "FastGeneratorInversion"]