Question: How would I code this using Python? Thank you in advance! Exercise 3.14 Define a function for the Poisson distribution and use it to plot
How would I code this using Python? Thank you in advance!
Exercise 3.14 Define a function for the Poisson distribution and use it to plot P(r; 1) for 1 = 4, 1 = 9, 1 = 25, and 1 = 100. Confirm that the range of r where the probability is nonzero is roughly given by i to + v. Discuss in words how the shape of the Poisson distribution changes as I becomes large. Hints: Use the factorial function in scipy.misc. For large 1, the factor \" becomes too large for python to deal with. The trick is to take advantage of the fact that r" = eln z" = en in x to combine this term with the e-) which is becoming very small, like so l'e-1 = er Ine -1 = exp(r In 1 1) You should write your function using this form. Recall that the natural log in python is np.log We have seen that as becomes large, the probability is spread over a large range of r values. This suggests that in the large / limit we can treat r as a continuous variable, which simplifies things considerably. In this limit we can also simplify our expression for the Poisson distribution. Exercise 3.14 Define a function for the Poisson distribution and use it to plot P(r; 1) for 1 = 4, 1 = 9, 1 = 25, and 1 = 100. Confirm that the range of r where the probability is nonzero is roughly given by i to + v. Discuss in words how the shape of the Poisson distribution changes as I becomes large. Hints: Use the factorial function in scipy.misc. For large 1, the factor \" becomes too large for python to deal with. The trick is to take advantage of the fact that r" = eln z" = en in x to combine this term with the e-) which is becoming very small, like so l'e-1 = er Ine -1 = exp(r In 1 1) You should write your function using this form. Recall that the natural log in python is np.log We have seen that as becomes large, the probability is spread over a large range of r values. This suggests that in the large / limit we can treat r as a continuous variable, which simplifies things considerably. In this limit we can also simplify our expression for the Poisson distribution
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
