LogitNormal

LogitNormal([loc, scale])

A logit-normal continuous random variable.

Methods

LogitNormal.ppf(q)

Percent point function (inverse of cdf) at q of the given RV.

LogitNormal.rvs([size, random_state])

Random variates of given type.

Attributes

class gumbi.arrays.LogitNormal(loc=0.5, scale=1)

Bases: rv_continuous

A logit-normal continuous random variable.

The probability density function for LogitNormal is:

\[f \left( x, \sigma \right) = \frac{1}{\sigma \sqrt{2 \pi}} e^{- \frac{ \left( \text{logit} (x) - \mu \right)^2}{2 \sigma^2}} \frac{1}{x \left( 1-x \right)} # noqa: E501\]

for \(0<x<1\), \(\sigma>0\)

A logit-normal random variable Y can be parameterized in terms of the mean, \(\mu\), and standard deviation, \(\sigma\), of the unique normally distributed random variable X such that expit(X) = Y. This parametrization corresponds to setting scale = σ and loc = expit(μ).

ppf(q)

Percent point function (inverse of cdf) at q of the given RV.

Parameters:
  • q (array_like) – lower tail probability

  • arg1 (array_like) – The shape parameter(s) for the distribution (see docstring of the instance object for more information)

  • arg2 (array_like) – The shape parameter(s) for the distribution (see docstring of the instance object for more information)

  • arg3 (array_like) – The shape parameter(s) for the distribution (see docstring of the instance object for more information)

  • ... (array_like) – The shape parameter(s) for the distribution (see docstring of the instance object for more information)

  • loc (array_like, optional) – location parameter (default=0)

  • scale (array_like, optional) – scale parameter (default=1)

Returns:

x – quantile corresponding to the lower tail probability q.

Return type:

array_like

rvs(size=None, random_state=None)

Random variates of given type.

Parameters:
  • arg1 (array_like) – The shape parameter(s) for the distribution (see docstring of the instance object for more information).

  • arg2 (array_like) – The shape parameter(s) for the distribution (see docstring of the instance object for more information).

  • arg3 (array_like) – The shape parameter(s) for the distribution (see docstring of the instance object for more information).

  • ... (array_like) – The shape parameter(s) for the distribution (see docstring of the instance object for more information).

  • loc (array_like, optional) – Location parameter (default=0).

  • scale (array_like, optional) – Scale parameter (default=1).

  • size (int or tuple of ints, optional) – Defining number of random variates (default is 1).

  • random_state ({None, int, numpy.random.Generator,) –

    numpy.random.RandomState}, optional

    If random_state is None (or np.random), the numpy.random.RandomState singleton is used. If random_state is an int, a new RandomState instance is used, seeded with random_state. If random_state is already a Generator or RandomState instance, that instance is used.

Returns:

rvs – Random variates of given size.

Return type:

ndarray or scalar