generalized Pareto distribution

Contents

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

genpareto 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:

  • xi, loc=0, scale=1

The interpretation of the parameters is:

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()
../_images/2f67478a5fbc77f2f8b3455b151a6b2788304a5b2e198113a0c052baaf71751d.png

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()
../_images/64d74d07c9f9b1b920fddb710fbbff04f9ad8f1c3e0c435a5f8a27f5e40f1a8f.png