(Python3) Use the provided cells as a reference to write a for loop that plots the Poisson PDF for a range of λ values from 10 to 100 (by tens) on a single plot.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

(Python3) Use the provided cells as a reference to write a for loop that plots the Poisson PDF for a range of λ values from 10 to 100 (by tens) on a single plot. 

lam = 75
# return the n value corresponding to the 0.1 percentile
mink = stats.poisson.ppf(0.001, lam)
# return the n value corresponding to the 99.9 percentile
maxk = stats.poisson.ppf(0.999, lam)
print (mink, maxk)
50.0 103.0
[90] create a range of x values over which to compute the PDF, ranging from minn to maxn
x = np.arange(mink,maxk)
len(x)
53
Now we're ready to actually compute the PDF, though actually in this case because the poisson distribution is discrete, this is more properly
called a PMF (Probability Mass Function):
[91] # compute pmf for given lam and range of x
poisson_pmf = stats.poisson.pmf(x, lam)
We can also just as easily compute the cumulative distribution function:
[92] poisson_cdf = stats.poisson.cdf(x, lam)
Transcribed Image Text:lam = 75 # return the n value corresponding to the 0.1 percentile mink = stats.poisson.ppf(0.001, lam) # return the n value corresponding to the 99.9 percentile maxk = stats.poisson.ppf(0.999, lam) print (mink, maxk) 50.0 103.0 [90] create a range of x values over which to compute the PDF, ranging from minn to maxn x = np.arange(mink,maxk) len(x) 53 Now we're ready to actually compute the PDF, though actually in this case because the poisson distribution is discrete, this is more properly called a PMF (Probability Mass Function): [91] # compute pmf for given lam and range of x poisson_pmf = stats.poisson.pmf(x, lam) We can also just as easily compute the cumulative distribution function: [92] poisson_cdf = stats.poisson.cdf(x, lam)
should follow a Poisson distribution. The probability density function is given by:
ak
P(k) = e¯^¸
k!
where is the mean of the distribution, so in a way, the expected number of occurrences, and k is the observed number of "occurrences" (a
natural number, i.e. integers starting at 0) in some time t. We will need to define a range of values for k over which to calculate the pdf, and it
can be difficult to choose these intelligently. One trick is to use the "percent point function" to evaluate the k value corresponding to a certain
percentile of the full distribution. For example ppf(0.01) corresponds to the k value where only 1% of the area under the PDF is less than k.
Let's create an appropriate range of k values for an arbitrary choice of 1:
Transcribed Image Text:should follow a Poisson distribution. The probability density function is given by: ak P(k) = e¯^¸ k! where is the mean of the distribution, so in a way, the expected number of occurrences, and k is the observed number of "occurrences" (a natural number, i.e. integers starting at 0) in some time t. We will need to define a range of values for k over which to calculate the pdf, and it can be difficult to choose these intelligently. One trick is to use the "percent point function" to evaluate the k value corresponding to a certain percentile of the full distribution. For example ppf(0.01) corresponds to the k value where only 1% of the area under the PDF is less than k. Let's create an appropriate range of k values for an arbitrary choice of 1:
Expert Solution
Step 1

A Poisson distribution is a distribution which shows the likely number of times that an event will occur within a pre-determined period of time. It is used for independent events which occur at a constant rate within a given interval of time.

matplotlib.pyplot is a collection of functions that make matplotlib work like MATLAB. Each pyplot function makes some change to a figure: e.g., creates a figure, creates a plotting area in a figure, plots some lines in a plotting area, decorates the plot with labels, etc.

 

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY