How slow is it? For me 100 million values take 5 seconds. The code just ccalls to the Rmath library to get the random number.
On Tuesday, September 22, 2015 at 11:51:19 AM UTC+2, Jon Norberg wrote: > > I need to get random variables from poisson distributions with different > lambda > > this is the only way I got it to work at the moment BUT its very slow! > > using Distributions > lambda=linspace(0.1,2,100) > out=zeros(Int64,100) > for i=1:length(lambda) > P=Poisson(lambda[i]) > out[i]=rand(P) > end > > Anyone have suggestions for speed improvements? > > Thanks > >