All problems
MGF of Poisson
Problem
Moment generating function of a Poisson random variable with rate lam evaluated at t:
M(t) = exp(lam * (e^t - 1)).
Hint
Take E[e^(tX)] and use the Poisson series.
Test cases
case 1
in: [1,0]
expected: 1
case 2
in: [2,1]
expected: 31.079973004503163
case 3
in: [1,2]
expected: 595.2944153807538
Starter codePython
import math
def mgf_poisson(lam, t):
# Your code here
pass3 test cases · run your code against them in the editor