vendredi 7 février 2020

Random geometric distribution across numbers

I would like to know whether it is possible to generate random numbers following a geometric distribution, but within a list of numbers.

Suppose I have a list such as:

a = [2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6] 

I would like to generate 81 values randomly, maintaining a p-value of .03.

I tried to use the following:

z = np.random.geometric(p=0.3, size=81)

But how can I draw only from a specific list of numbers?




Aucun commentaire:

Enregistrer un commentaire