generalized Pareto distribution#
The generalized Pareto distribution a probability distribution that is a often used to model the tails of another probaility distribution.
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()=2145894488;
Random Number Generator: MT19937 - initialized with 1000 initial calls.
Syntax#
- property genpareto#
generalized Pareto distribution
genparetois 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:xi,loc=0,scale=1
The interpretation of the parameters is:
xi(flxPara): shape parameterloc(flxPara): location parameterscale(flxParaPosNo0): scale parameter
Example:
rv_1 = flx.rv({'name':'rv_1', 'type':'genpareto', 'xi':0.1 })
rv_2 = flx.rv({'name':'rv_2', 'type':'genpareto', 'xi':-0.7 })
rv_lst = [ rv_1, rv_2 ]
PDF#
x_bound = 4.
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':0., 'x_up':x_bound})
ax.set_ylim([0., None])
ax.set_xlim([0., x_bound])
plt.xlabel(r"$x$")
plt.ylabel(r"$f_X(x)$")
plt.legend()
plt.show()
CDF#
x_bound = 4.
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':0., 'x_up':x_bound})
ax.set_ylim([0., 1.])
ax.set_xlim([0., x_bound])
plt.xlabel(r"$x$")
plt.ylabel(r"$F_X(x)$")
plt.legend()
plt.show()