The Poisson random variable is a discrete random variable that models how many t
ID: 3231030 • Letter: T
Question
The Poisson random variable is a discrete random variable that models how many taxis come by in a fixed time, or how many charged particles are detected in a fixed time, or how hard drive crashes in a fixed time. The probability mass function of the Poisson random variable with mean (and variance) lambda is f(x) = {lambda^x e^-lambda/x!, x = 0, 1... 0, otherwise. Write an R program to generate i.i.d. Poisson random variables with mean one, X_1,...,X_n from uniform random variables, Z_1,...,Z_n using the inverse distribution transformation method. Use your program to print out Z_1,...,Z_n and X_1,...,X_n for n = 10.Explanation / Answer
The function takes as input some value x and tells you what is the probability of obtaining Xx
So, FX(x)=Pr(Xx)=p and thus F-1(p) = x
The idea is very simple: it is easy to sample values uniformly from U(0,1), so if you want to sample from some FX, just take values uU(0,1) and pass u through F1X to obtain x's, F1X(u) = x
Algorithm for generating a Poisson rv X with mean
i Set X = 0, P = 1
ii Generate U unif (0,1), set P = U P
iii If P < e , then stop. Otherwise if P e , then set X = X + 1 and go back to ii.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.