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
gumbelis 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,alphamu,sdval_1,pr_1,val_2,pr_2
The interpretation of the parameters is:
mu(flxPara): mean valuesd(flxParaPosNo0): standard deviation; value must be positiveu(flxPara): location parameteralpha(flxParaPosNo0): inverse scale parameter; value must be positiveval_1(flxParaPosNo0):pr_1quantile`pr_1(flxParaPr): probability that the value of the distribution is smaller or equal than val_1val_2(flxParaPosNo0):pr_2quantile`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:
The PDF \(f_X(x)\) can also be expressed in terms of the PDF of the Standard Normal distribution \(\varphi(\cdot)\):
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()
CDF#
The CDF \(F_X(x)\) of the log-normal distribution is defined as:
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()
Quantile function#
The quantile function of the log-normal distribution is:
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:
Conversely, a log-normal random variable \(X\) with parameters \(\lambda\) and \(\zeta\) can be generated from a standard Normal variable as:
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: