# S.Chekanov
from org.apache.commons.math3.random import *
from jhplot import *
r=RandomDataGenerator()
c1=HPlot()
c1.visible()
c1.setRangeX(0,100)
h1=H1D("Gamma x Poisson",100,0,100)
tot=100000
shape=10
scale=3.0
r=RandomDataGenerator()
for i in range(tot):
mean=r.nextGamma(shape,scale)
value=r.nextPoisson(mean)
# print value
h1.fill(value)
c1.draw(h1)
Ads help maintain this website.