1. Learn
  2. /
  3. Courses
  4. /
  5. Statistical Thinking in Python (Part 2)

Connected

Exercise

How is this parameter optimal?

Now sample out of an exponential distribution with \(\tau\) being twice as large as the optimal \(\tau\). Do it again for \(\tau\) half as large. Make CDFs of these samples and overlay them with your data. You can see that they do not reproduce the data as well. Thus, the \(\tau\) you computed from the mean inter-no-hitter times is optimal in that it best reproduces the data.

Note: In this and all subsequent exercises, the random number generator is pre-seeded for you to save you some typing.

Instructions

100 XP
  • Take 10,000 samples out of an Exponential distribution with parameter \(\tau_{1/2} = \tau/2\).
  • Take 10,000 samples out of an Exponential distribution with parameter \(\tau_{2} = 2 \tau\).
  • Generate CDFs from these to sets of samples.
  • Add these two CDFs as lines to your plot.
  • Draw the plot.