Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This Week's Questions are about the Zero-Inflated Poisson distribution (ZIP for short) . This is a discrete distribution, with two parameters q and ) (where
This Week's Questions are about the Zero-Inflated Poisson distribution (ZIP for short) . This is a discrete distribution, with two parameters q and ) (where 0 > 0). If a random variable X" has a ZIP(q, >) distribution, then its probability mass function px is given by: px(0) = Pr[X = 0] = q+ (1 -q)e-> px(k) = Pr[X = k] = (1 -q) k! for k = 1, 2,3, ... So, like the "regular" Poisson, X has the natural numbers N = {0, 1, 2, 3, ...} as possible outcomes. Your tasks are: 1. Create a function called dZIP, which satisfies the following: . It has three arguments: one called k (with no default value), one called q (with default value set to 0) and one called lambda (with default value set to 1). . It returns the probability mass function px () of a ZIP random variable (with parameters q and lambda ), and evaluated at k. 2. Create a function called pZIP , which satisfies the following: . It has the same three arguments (and default values) as the previous function dZIP . . It returns the CDF (cumulative distribution function) Fx(k ) of a ZIP random variable (with parameters q and lambda ), and evaluated at k.Hint: You can call a function (e.g. dZIP ) within another function. But careful that if you do this, all arguments of the inner function (e.g. dZIP ) must be correctly specified (and even if their names are the same as those of the outer function, e.g. pZIP ). 3. Using the functions you created before (or otherwise), compute the expected value E X] for X ~ ZIP(q = 1/*, > = v2) and place the result in a variable called E.X 4. Create a function called qZIP , which satisfies the following: . It has the same three arguments (and default values) as the previous two functions dZIP, pZIP. . It returns the quantile function Q(k) of a ZIP random variable (with parameters q and Lambda and evaluated at k ) where the quantile function Q (k ) is defined as follows: Q(k) = min{r E N : k
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started