Chapter 14. Analytic Methods
This book has focused on computational methods like simulation and resampling, but some of the problems we solved have analytic solutions that can be much faster to compute.
This chapter presents some of these methods and explains how they work. At the end of the chapter, I make suggestions for integrating computational and analytic methods for data analysis.
Normal Probability Plots
Many analytic methods are based on the properties of the normal distribution, for two reasons: distributions of many measurements in the real world are well-approximated by normal distributions, and normal distributions have mathematical properties that make them useful for analysis.
To demonstrate the first point, we’ll look at some of the measurements in the penguin dataset. Then we’ll explore the mathematical properties of the normal distribution. Instructions for downloading the data are in the notebook for this chapter.
We can read the data like this:
penguins=pd.read_csv("penguins_raw.csv")penguins.shape
(344, 17)
The dataset contains measurements from three penguin species. For this example, we’ll select the Adélie penguins:
adelie=penguins.query('Species.str.startswith("Adelie")').copy()len(adelie)
152
To see if penguin weights follow a normal distribution, we’ll compute the empirical CDF of the data:
fromempiricaldistimportCdfweights=adelie["Body Mass (g)"].dropna()cdf_weights=Cdf.from_seq(weights)
And we’ll compute the analytic CDF of a normal ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access