Skip to content

Latest commit

 

History

History
123 lines (76 loc) · 2.6 KB

Beta.rst

File metadata and controls

123 lines (76 loc) · 2.6 KB

Beta Distribution

Table of contents


The density function of the Beta distribution:

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

where \mathcal{B}(a,b) denotes the Beta function.

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

.. autofunction:: pystats.dbeta(x: float, shape1: float, shape2: float, log: bool = False) -> float
   :noindex:

.. autofunction:: pystats.dbeta(x: List[float], shape1: float, shape2: float, log: bool = False) -> List[float]
   :noindex:


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

F(x; a, b) = \int_0^x f(z; a,b) dz = I_x (a,b)

where I_x (a,b) denotes the regularized incomplete Beta function.

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

.. autofunction:: pystats.pbeta(p: float, shape1: float, shape2: float, log: bool = False) -> float
   :noindex:

.. autofunction:: pystats.pbeta(p: List[float], shape1: float, shape2: float, log: bool = False) -> List[float]
   :noindex:


The quantile function of the Beta distribution:

q(p; a,b) = \inf \left\{ x : p \leq I_x (a,b) \right\}

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

.. autofunction:: pystats.qbeta(q: float, shape1: float, shape2: float) -> float
   :noindex:

.. autofunction:: pystats.qbeta(q: List[float], shape1: float, shape2: float) -> List[float]
   :noindex:


Random sampling for the Beta distribution is achieved by simulating two independent gamma-distributed random variables, X \sim G(a,1), Y \sim G(a,1), then returning:

Z = \frac{X}{X+Y} \sim B(a,b)
.. autofunction:: pystats.rbeta(shape1: float, shape2: float) -> float
   :noindex:

.. autofunction:: pystats.rbeta(n: int, shape1: float, shape2: float) -> List[float]
   :noindex: