1. Learn
  2. /
  3. Courses
  4. /
  5. Case Studies in Statistical Thinking

Exercise

Interearthquake time estimates for Parkfield

In this exercise, you will first compute the best estimates for the parameters for the Exponential and Gaussian models for interearthquake times. You will then plot the theoretical CDFs for the respective models along with the formal ECDF of the actual Parkfield interearthquake times.

Instructions

100 XP
  • Compute the mean interearthquake time and store it as mean_time_gap. The time gaps between the major earthquakes, in units of years, are stored in time_gap.
  • Compute the standard deviation of the interearthquake times and store it as std_time_gap.
  • Use np.random.exponential() to draw 10,000 samples out of an Exponential distribution with the appropriate mean. Store them in the variable time_gap_exp.
  • Use np.random.normal() to draw 10,000 samples out of a Normal distribution with the appropriate mean and standard deviation. Store them in the variable time_gap_norm.
  • Plot the theoretical CDFs in one line each, using the *dcst.ecdf() approach introduced earlier in this chapter.
  • Plot the ECDF using the formal=True, min_x=-10, and max_x=50 keyword arguments.