generalized Student’s t-distribution

generalized Student’s t-distribution#

Student’s t-distribution, generalized with location and scale parameter.

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()=658400408;
Random Number Generator: MT19937 - initialized with 1000 initial calls.

Syntax#

property studentstgen#

generalized Student’s t-distribution

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

  • dof, loc, scale

  • dof, loc, val_1, pr_1

The interpretation of the parameters is:

Example:

rv_1 = flx.rv({'name':'rv_1', 'type':'studentstgen', 'dof':3., 'loc':2., 'scale':1. })
rv_2 = flx.rv({'name':'rv_2', 'type':'studentstgen', 'dof':3., 'loc':2., 'val_1':1., 'pr_1':0.05 })
rv_lst = [ rv_1, rv_2 ]

PDF#

x_bound = 6.

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':-x_bound, 'x_up':x_bound}) 

ax.set_ylim([0., None])
ax.set_xlim([-x_bound, x_bound])
plt.xlabel(r"$x$")
plt.ylabel(r"$f_X(x)$")
plt.legend()
plt.show()
../_images/1ae62641373712816f1eb91c0f7e4c08e8bcbee12017eb0f1d4e855d0ebada53.png

CDF#

x_bound = 6.

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':-x_bound, 'x_up':x_bound}) 

ax.set_ylim([0., 1.])
ax.set_xlim([-x_bound, x_bound])
plt.xlabel(r"$x$")
plt.ylabel(r"$F_X(x)$")
plt.legend()
plt.show()
../_images/94753081ff110f527d4800f37bbd444730ae28412c6c53756983afe917ee04c6.png