Python Forum

Full Version: generate random variables based on a non-standard t-distribution
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,


does anyone know how to generate random variables based on a non-standard t-distribution?
np.random only accepts the standard t distribution with df as input factor.

Best,
Nathalie
Hi Thomas, thanks for your reply.
Also numpy only takes the standard t distribution standard_t with (df[, size]) as input factors. However, I would like also input loc and scale.
So None of the 35 distributions you can choose from work for you?
(Dec-01-2019, 01:47 PM)nathalie Wrote: [ -> ]does anyone know how to generate random variables based on a non-standard t-distribution?

Take a look at scipy.stats module. It allows to define custom distribution (continuous and discreet). What means non-standard t-distribution; maybe you can sample from standard t-dist and filter resulted points somehow.