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
studentstgenis 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,scaledof,loc,val_1,pr_1
The interpretation of the parameters is:
dof(flxParaPosNo0): degrees of freedomloc(flxPara): location parameterscale(flxParaPosNo0): scale parameterval_1(flxPara):pr_1quantile`pr_1(flxParaPr): probability that the value of the distribution is smaller or equal than val_1
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()
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()