In [1]:
import numpy as np
import matplotlib.pyplot as plt
import sympy
import scipy.special as spsp
import scipy.stats as spst
%matplotlib inline
Can we use Geometric distribution with $p=0.1$ to generate the samples from a Poisson distribution with $\lambda=10$?
In [2]:
x=np.arange(0,50)
p=0.1
lm=10
pmf_geo=(1-p)**x*p
pmf_poisson=spst.poisson.pmf(x,lm)
plt.plot(x,pmf_geo,marker=”o”,label=”geo”)
plt.plot(x,pmf_poisson,marker=”o”,label=”pmf_poisson”)
plt.legend()
plt.show()
#from the plot below, we could see that the target distribution has a much fatter tail
#the tail part makes the whole thing not working, because the target distribution has a much fatter tail than the proposal distribution
#however, if we switch the roles of them, it will definitely working

Example the ratio between PMF target and PMF proposal
In [3]:
#working
plt.plot(x,pmf_poisson/pmf_geo,marker=”o”)
plt.show()

Can we use a Poisson distribution with $\lambda=10$ to generate samples from Geometric distribution with $p=0.1$?
In [4]:
#working
plt.plot(x,pmf_poisson/pmf_geo,marker=”o”)
plt.show()

In [5]:
#not working
#use geometric as target and poisson as proposal
plt.plot(x,pmf_geo/pmf_poisson,marker=”o”)
plt.show()
# from the plot we could see that the c value is exploding, which is really inefficient as it is infinitely large

Our target distribution exibits a fatter tail. In other words, it needs a higher chance of getting large values than the proposal distribution could provide.
In [6]: