lundi 17 septembre 2018

Random number pull from array MATLAB Poisson

This used to be simple in MATLAB and still is in Python. I have an array of Lambdas that I am looking to produce poisson distributed random numbers to insert into a histogram.

lambda = [0.1 0.4]

I used to be able to put in there:

n = poissrnd(a,10)

and get back an array of 10 rows by 2 columns of randomly generated Poisson numbers for each of the lambdas (each column representing 10 samples from each of the lambdas). For some reason, this has changed - and Im not sure why.

In Python - this is still doable by just putting in:

n = np.random.poisson(lambda, [10,2])

Ive been banging my head against the table - any help would be appreciated...




Aucun commentaire:

Enregistrer un commentaire