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

Connected

Exercise

Do the data follow our story?

You have modeled no-hitters using an Exponential distribution. Create an ECDF of the real data. Overlay the theoretical CDF with the ECDF from the data. This helps you to verify that the Exponential distribution describes the observed data.

It may be helpful to remind yourself of the function you created in the previous course to compute the ECDF.

Instructions

100 XP
  • Compute an ECDF from the actual time between no-hitters (nohitter_times). You can use the ecdf() function you wrote in the prequel course.
  • Create a CDF from the samples you took in the last exercise (inter_nohitter_time).
  • Plot the CDF as a line. Then overlay the ECDF of the real data as points.
  • Set a 2% margin on the plot and label the axes.
  • Show the plot.