Parkfield earthquake magnitudes
As usual, you will start with EDA and plot the ECDF of the magnitudes of earthquakes detected in the Parkfield region from 1950 to 2016. The magnitudes of all earthquakes in the region from the ANSS ComCat are stored in the NumPy array mags
.
When you do it this time, though, take a shortcut in generating the ECDF. You may recall that putting an asterisk before an argument in a function splits what follows into separate arguments. Since dcst.ecdf()
returns two values, we can pass them as the x
, y
positional arguments to plt.plot()
as plt.plot(*dcst.ecdf(data_you_want_to_plot))
.
You will use this shortcut in this exercise and going forward.
This exercise is part of the course
Case Studies in Statistical Thinking
Exercise instructions
- Generate a plot of the ECDF in one line, using the
*dcst.ecdf()
approach describe above. Callplt.plot()
with themarker='.'
andlinestyle='none'
keyword arguments as usual. - Label the x-axis
'magnitude'
, y-axis'ECDF'
, and show the plot.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Make the plot
# Label axes and show plot