Gumbel distribution#

In the following, let \(X\) be a random variable that follows a Gumbel distribution with location parameter \(u\) and inverse scale parameter \(\alpha\). The support of \(X\) is \(\mathbb{R}\). An outcome of \(X\) is denoted as \(x\).

import fesslix as flx
flx.load_engine()

import numpy as np
import fesslix.plot as flx_plot
import matplotlib.pyplot as plt
%matplotlib inline
Random Number Generator: MT19937 - initialized with rand()=1661253886;
Random Number Generator: MT19937 - initialized with 1000 initial calls.

Syntax#

property gumbel#

Gumbel distribution

gumbel is a distribution type (flx_rv_type) for Random variables in Fesslix.

Parametrization:

Parameters of the distribution can be specified as additional key-value pairs in an object of type flx_rv_config. The following combinations of parameters are accepted:

  • u, alpha

  • mu, sd

  • val_1, pr_1, val_2, pr_2

The interpretation of the parameters is:

  • mu (flxPara): mean value

  • sd (flxParaPosNo0): standard deviation; value must be positive

  • u (flxPara): location parameter

  • alpha (flxParaPosNo0): inverse scale parameter; value must be positive

  • val_1 (flxParaPosNo0): pr_1 quantile

  • `pr_1 (flxParaPr): probability that the value of the distribution is smaller or equal than val_1

  • val_2 (flxParaPosNo0): pr_2 quantile

  • `pr_2 (flxParaPr): probability that the value of the distribution is smaller or equal than val_2

Example:

rv_1 = flx.rv({'name':'rv_1', 'type':'gumbel', 'mu':2., 'sd':2. })
rv_2 = flx.rv({'name':'rv_2', 'type':'gumbel', 'u':2., 'alpha':1. })
rv_3 = flx.rv({'name':'rv_3', 'type':'gumbel', 'val_1':2.5, 'pr_1':0.05, 'val_2':3.2, 'pr_2':0.5 })
rv_lst = [ rv_1, rv_2, rv_3 ]

Properties#

TODO

PDF#

The PDF \(f_X(x)\) of the log-normal distribution is:

\[f_X(x) = \frac{1}{(x-\varepsilon)\cdot\zeta\cdot\sqrt{2\pi}} \cdot\exp\left[-\frac{1}{2}\left(\frac{\ln(x-\varepsilon)-\lambda}{\zeta}\right)^2\right]\]

The PDF \(f_X(x)\) can also be expressed in terms of the PDF of the Standard Normal distribution \(\varphi(\cdot)\):

\[f_X(x) = \frac{1}{(x-\varepsilon)\cdot\zeta}\cdot\varphi\left(\frac{\ln(x-\varepsilon)-\lambda}{\zeta}\right)\]
x_up = 8.

fig, ax = plt.subplots(figsize=(10, 4))

for rv in rv_lst:
    flx_plot.draw_pdf(ax, rv, config_dict={'label':rv.get_name(), 'x_low':1e-6, 'x_up':x_up}) 

ax.set_ylim([0., None])
ax.set_xlim([0., x_up])
plt.xlabel(r"$x$")
plt.ylabel(r"$f_X(x)$")
plt.legend()
plt.show()
../_images/78fb54468f7b87d79da23b368d7219dad96641ee3cafc2b8625ad80e38cc1fad.png

CDF#

The CDF \(F_X(x)\) of the log-normal distribution is defined as:

\[F_X(x) = \Phi\left(\frac{\ln(x-\varepsilon)-\lambda}{\zeta}\right)\]

where \(\Phi(\cdot)\) is the CDF of the Standard Normal distribution.

x_up = 8.

fig, ax = plt.subplots(figsize=(10, 4))

for rv in rv_lst:
    flx_plot.draw_cdf(ax, rv, config_dict={'label':rv.get_name(), 'x_low':1e-6, 'x_up':x_up}) 
    
ax.set_ylim([0., 1.])
ax.set_xlim([0., x_up])
plt.xlabel(r"$x$")
plt.ylabel(r"$F_X(x)$")
plt.legend()
plt.show()
../_images/19cf1601e62d77b4286eb1433b5de1d319f95afec7138c39f67d375a13def27f.png

Quantile function#

The quantile function of the log-normal distribution is:

\[F_X^{-1}(p) = \exp\left( \lambda + \zeta \cdot\Phi^{-1}(p) \right) + \varepsilon \;, \quad p\in(0,1)\]

where \(\Phi^{-1}(\cdot)\) is the quantile function of the Standard Normal distribution.

Standardizing Normal random variables#

The log-normal random variable \(X\) can be transformed to a Standard Normal distribution \(U\) through:

\[U = \frac{\ln(X-\varepsilon)-\lambda}{\zeta}\]

Conversely, a log-normal random variable \(X\) with parameters \(\lambda\) and \(\zeta\) can be generated from a standard Normal variable as:

\[X = \exp\left(\lambda + \zeta \cdot U\right)+\varepsilon\]

Parametrization in terms of \(\mu_X\) and \(\sigma_X\)#

If the mean and standard deviation are given, the parameters \(\lambda\) and \(\zeta\) can be derived as:

\[\lambda = \ln\left(\mu_X-\varepsilon\right)-\frac{1}{2}\ln\left(\frac{\sigma_X^2}{(\mu_X-\varepsilon)^2}+1\right)\]
\[\zeta = \sqrt{\ln\left(\frac{\sigma_X^2}{(\mu_X-\varepsilon)^2}+1\right)}\]

Covariance of two correlated log-normal random variables#

The correlation coefficient \(\rho\) between two correlated log-normal random variables \(X_1\) and \(X_2\) is

\[\rho = \frac{\operatorname{COV}(X_1,X_2)}{\sigma_1\sigma_2} = \frac{\exp\left(\rho^\prime\sqrt{\ln(\delta_1^2+1)\ln(\delta_2^2+1)}\right)-1}{\delta_1\delta_2}\]

where \(\delta_1\) and \(\delta_2\) is the coefficient of variation of \(X_1\) and \(X_2\), respectively; \(\rho^\prime\) is the correlation coefficient of the underlying standard Normal random variables.