S. Chirag
S. Chirag

Reputation: 117

Why for X=1 probability mass function and cummulative density function differ?

Working on Poisson Distribution, Probability mass function works on discrete values and Cummulative Density Function adds them up (This is what I know correct me if I am wrong please). Since they will differ from each other in values why for X = 1 both have different probabilities? It starts from there so why they are different?

x= np.arange(1,10,1)
y = poisson.pmf(x,4.6)
print(y)

Output: [0.04623844 0.10634842 0.16306758 0.18752772 0.1725255 0.13226955 0.08691999 0.04997899 0.02554482]

x= np.arange(1,10,1)
y = poisson.cdf(x,4.6)
print(y)

Output: [0.05629028 0.1626387 0.32570628 0.513234 0.6857595 0.81802905 0.90494904 0.95492804 0.98047286]

First Values are different. Please Explain.

Upvotes: 0

Views: 37

Answers (2)

SuperShoot
SuperShoot

Reputation: 10872

You are forgetting zero:

>>> poisson.cdf(1, 4.6)
0.056290280169948054

>>> poisson.pmf(0, 4.6) + poisson.pmf(1, 4.6)
0.056290280169948075

So the first element in your cdf() output is the cumulative of x=0 & x=1

Upvotes: 1

user2974951
user2974951

Reputation: 10385

Simple mistake, Poisson distribution is defined on the whole positive number line, from 0 to infinity. You forgot to include the 0 in your calculations.

> dpois(0:10,4.6)
 [1] 0.01005184 0.04623844 0.10634842 0.16306758 0.18752772 0.17252550 0.13226955 0.08691999 0.04997899 0.02554482 0.01175062

> ppois(0:10,4.6)
 [1] 0.01005184 0.05629028 0.16263870 0.32570628 0.51323400 0.68575950 0.81802905 0.90494904 0.95492804 0.98047286 0.99222347

Upvotes: 1

Related Questions