jeudi 26 mars 2020

Python - define a function with probability distribution in arguments

In python, I would like to write a function which takes in arguments the name of a distribution (from scipy.stats), and returns an array of samples from that distribution.

How would I do that? I guess I would have to convert a string in some sense.

In addition, from specifying the name of a distribution in argument, how could I use its cdf or density in the function?




Aucun commentaire:

Enregistrer un commentaire