Skip to content

Latest commit

 

History

History
114 lines (72 loc) · 2.64 KB

Laplace.rst

File metadata and controls

114 lines (72 loc) · 2.64 KB

Laplace Distribution

Table of contents


The density function of the Laplace distribution:

f(x; \mu, \sigma) = \frac{1}{2 \sigma} \exp \left( - \frac{|x-\mu|}{\sigma} \right)

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

.. autofunction:: pystats.dlaplace(x: float, mu: float = 0.0, sigma: float = 1.0, log: bool = False) -> float
   :noindex:

.. autofunction:: pystats.dlaplace(x: List[float], mu: float = 0.0, sigma: float = 1.0, log: bool = False) -> List[float]
   :noindex:


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

F(x; \mu, \sigma) = \int_{-\infty}^x f(z; \mu, \sigma) dz = \frac{1}{2} + \frac{1}{2} \times \text{sign} ( x - \mu ) \times \left( 1 - \exp \left( - \frac{|x - \mu|}{\sigma} \right) \right)

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

.. autofunction:: pystats.plaplace(p: float, mu: float = 0.0, sigma: float = 1.0, log: bool = False) -> float
   :noindex:

.. autofunction:: pystats.plaplace(p: List[float], mu: float = 0.0, sigma: float = 1.0, log: bool = False) -> List[float]
   :noindex:


The quantile function of the Laplace distribution:

q(p; \mu, \sigma) = \mu - \sigma \times \text{sign}(p - 0.5) \times \ln(1 - 2 | p - 0.5 |)

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

.. autofunction:: pystats.qlaplace(q: float, mu: float = 0.0, sigma: float = 1.0) -> float
   :noindex:

.. autofunction:: pystats.qlaplace(q: List[float], mu: float = 0.0, sigma: float = 1.0) -> List[float]
   :noindex:


Random sampling for the Laplace distribution is achieved via the inverse probability integral transform.

.. autofunction:: pystats.rlaplace(mu: float = 0.0, sigma: float = 1.0) -> float
   :noindex:

.. autofunction:: pystats.rlaplace(n: int, mu: float = 0.0, sigma: float = 1.0) -> List[float]
   :noindex: