Skip to content

Latest commit

 

History

History
122 lines (76 loc) · 2.84 KB

Log-Normal.rst

File metadata and controls

122 lines (76 loc) · 2.84 KB

Log-Normal Distribution

Table of contents


The density function of the log-Normal distribution:

f(x; \mu, \sigma) = \frac{1}{x} \frac{1}{\sqrt{2 \pi} \sigma} \exp \left( - \frac{(\ln x-\mu)^2}{2 \sigma^2} \right)

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

.. autofunction:: pystats.dlnorm(x: float, mean: float = 0.0, sd: float = 1.0, log: bool = False) -> float
   :noindex:

.. autofunction:: pystats.dlnorm(x: List[float], mean: float = 0.0, sd: float = 1.0, log: bool = False) -> List[float]
   :noindex:


The cumulative distribution function (CDF) of the log-Normal distribution:

F(x; \mu, \sigma) = \int_0^x f(z; \mu, \sigma) dz = \frac{1}{2} + \frac{1}{2} \times \text{erf} \left( \frac{\ln (x) - \mu}{\sigma} \right)

where \text{erf}(\cdot) denotes the Gaussian error function.

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

.. autofunction:: pystats.plnorm(p: float, mean: float = 0.0, sd: float = 1.0, log: bool = False) -> float
   :noindex:

.. autofunction:: pystats.plnorm(p: List[float], mean: float = 0.0, sd: float = 1.0, log: bool = False) -> List[float]
   :noindex:


The quantile function of the log-Normal distribution:

q(p; \mu, \sigma) = \exp \left( \mu + \sqrt{2} \sigma \times \text{erf}^{-1} \left( 2 p - 1 \right) \right)

where \text{erf}^{-1}(\cdot) denotes the inverse Gaussian error function.

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

.. autofunction:: pystats.qlnorm(q: float, mean: float = 0.0, sd: float = 1.0) -> float
   :noindex:

.. autofunction:: pystats.qlnorm(q: List[float], mean: float = 0.0, sd: float = 1.0) -> List[float]
   :noindex:


Random sampling for the log-Normal distribution is achieved by simulating X \sim N(\mu, \sigma^2), then returning

Z = \exp( X ) \sim \text{Lognormal} (\mu, \sigma^2)
.. autofunction:: pystats.rlnorm(mean: float = 0.0, sd: float = 1.0) -> float
   :noindex:

.. autofunction:: pystats.rlnorm(n: int, mean: float = 0.0, sd: float = 1.0) -> List[float]
   :noindex: