How to generate an array of poisson distributed (without any built-in function) 0 and 1 of a known lambda value?

6 vues (au cours des 30 derniers jours)
I want an array of 0 and 1 where the occurrences of the event are limited to '1' for a certain time of observation(bin). The values should be Poisson distributed, where I can input the lambda value. How can I code this on MATLAB without use any Poisson's built-in function?
  4 commentaires
John D'Errico
John D'Errico le 29 Oct 2020
Modifié(e) : John D'Errico le 29 Oct 2020
Do you have such a low Poisson rate that you KNOW there will never be anything larger than a 1? If you can never have more than 1 arrival, then it is not a true Poisson. So are you really sure this is a Poisson process? As Jeff points out, you can reduce this to a simple binomial sampling based on your statement. Just decide the rate you want to see.
Yun-Hui Chen
Yun-Hui Chen le 30 Oct 2020
Oh, I'm so sorry that I did't describe the problem clearly.
I want the figure's x-axis sample size's range is in [0,1], and the y-axis is mean the occuttences of the event(like the customer come) are limited to '1'.
My problem is like generate a Poisson random variable. I have read ABUL HASNAT's ask whose ask is similar my problem for reference. But ABUL HASNAT's code will run the event like two customers arrival in the same time(like below's picture). I want change the code's Poisson random variables to if it has the Poisson random then only show '1' mean the event happen.

Connectez-vous pour commenter.

Réponse acceptée

Ameer Hamza
Ameer Hamza le 29 Oct 2020
Read about inverse transform sampling() https://en.wikipedia.org/wiki/Inverse_transform_sampling . You will at least need to use rand().

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by