Skip to content

Latest commit

 

History

History
114 lines (72 loc) · 2.48 KB

Uniform.rst

File metadata and controls

114 lines (72 loc) · 2.48 KB

Uniform Distribution

Table of contents


The density function of the Uniform distribution:

f(x; a, b) = \frac{1}{b-a} \times \mathbf{1}[ a \leq x \leq b]

Methods for scalar input, as well as for list input, are listed below.

.. autofunction:: pystats.dunif(x: float, min: float = 0.0, max: float = 1.0, log: bool = False) -> float
   :noindex:

.. autofunction:: pystats.dunif(x: List[float], min: float = 0.0, max: float = 1.0, log: bool = False) -> List[float]
   :noindex:


The cumulative distribution function (CDF) of the Uniform distribution:

F(x; a, b) = \int_{a}^x f(z; a, b) dz = \frac{x - a}{b-a} \times \mathbf{1}[ a \leq x \leq b] + \times \mathbf{1}[x > b]

Methods for scalar input, as well as for list input, are listed below.

.. autofunction:: pystats.punif(p: float, min: float = 0.0, max: float = 1.0, log: bool = False) -> float
   :noindex:

.. autofunction:: pystats.punif(p: List[float], min: float = 0.0, max: float = 1.0, log: bool = False) -> List[float]
   :noindex:


The quantile function of the Uniform distribution:

q(p; a, b) = a + p(b-a)

Methods for scalar input, as well as for list input, are listed below.

.. autofunction:: pystats.qunif(q: float, min: float = 0.0, max: float = 1.0) -> float
   :noindex:

.. autofunction:: pystats.qunif(q: List[float], min: float = 0.0, max: float = 1.0) -> List[float]
   :noindex:


Random sampling for the Uniform distribution is achieved via the uniform_real_distribution class from the C++ standard library, imported from <random>.

.. autofunction:: pystats.runif(min: float = 0.0, max: float = 1.0) -> float
   :noindex:

.. autofunction:: pystats.runif(n: int, min: float = 0.0, max: float = 1.0) -> List[float]
   :noindex: