How can you generate a Poisson distributed random variable?
Anonymous
We can first look at the pmf of the Poisson distributed random variable :P(X=k) = exp(-lambda)*lambda^(k)/k! Then, since this is a discrete rv, one way we can simulate the Poisson rv is by making a table as shown below (assuming parameter lambda=4): k P(X=k) P(X<=k) ----------------------------------------------- 0 0.0183156 0.0183156 1 0.0732626 0.0915782 2 0.1465251 0.2381033 and so on. Depending on the precision of the simulation necessary and the possible cases of high occurrences, around k=11 to k=15 may be simulated for lambda=4 (P(X<=11) = 0.9990848, whereas P(X<=15) = 0.9999951). This may need to be tweaked for parameter lambda that is significantly different from lambda=4. After this table is constructed, the following algorithm may be used to generated X~Poisson(lambda): -Generate U~Uniform(0,1) using a pseudo-random number generator -Return k such that P(X<=k-1)
Check out your Company Bowl for anonymous work chats.