Implement the Poisson distribution Probability Mass Function (PMF) and Cumulative Distribution Function (CDF). The Poisson distribution models the count of events in a fixed interval with average rate λ.
Poisson Distribution:
Probability Mass Function:
P(X=k)=k!e−λλkCumulative Distribution Function:
P(X≤k)=i=0∑ki!e−λλilam: float - Rate parameter (λ > 0)k: int - Number of events (k ≥ 0)Input: lam=3, k=2
Output: pmf≈0.2240, cdf≈0.4232
Input: lam=2.5, k=0
Output: pmf≈0.0821, cdf≈0.0821
Input: lam=1.0, k=1
Output: pmf≈0.3679, cdf≈0.7358
Use np.log() and np.exp() for numerical stability in factorial computation.
For CDF, sum PMF values from i=0 to k using a loop.
Use np.sum(np.log(np.arange(1, k+1))) for log factorial.
Sign in to take notes on this problem
Accepts: number
Accepts: number
Implement the Poisson distribution Probability Mass Function (PMF) and Cumulative Distribution Function (CDF). The Poisson distribution models the count of events in a fixed interval with average rate λ.
Poisson Distribution:
Probability Mass Function:
P(X=k)=k!e−λλkCumulative Distribution Function:
P(X≤k)=i=0∑ki!e−λλilam: float - Rate parameter (λ > 0)k: int - Number of events (k ≥ 0)Input: lam=3, k=2
Output: pmf≈0.2240, cdf≈0.4232
Input: lam=2.5, k=0
Output: pmf≈0.0821, cdf≈0.0821
Input: lam=1.0, k=1
Output: pmf≈0.3679, cdf≈0.7358
Use np.log() and np.exp() for numerical stability in factorial computation.
For CDF, sum PMF values from i=0 to k using a loop.
Use np.sum(np.log(np.arange(1, k+1))) for log factorial.
Sign in to take notes on this problem
Accepts: number
Accepts: number