mercredi 23 décembre 2015

In Scipy why does custom.rvs() having uniform probability return the values in the begining region only?

If I generate a array

custom=np.ones(800, dtype=np.float32)

Then create a Custom Probability distribution out of it using

custom=normalize(custom)[0]
customPDF = stats.rv_discrete(name='pdfX', values=(np.arange(800), custom))

Then if I use

customPDF.rvs()

I get values returned in the range 0 - 20, whereas i expect random numbers varying from 0 to 800.

The following code gives me required output,

random.uniform(0,800) 

But due to the necessity of being able to manipulate the probability distribution through altering the custom array, i have to use customPDF.rvs()

is there a solution to this or why this is happening??




Aucun commentaire:

Enregistrer un commentaire