From 7becaf2d4782d7627c2c9cd22cf2220be11a9ae1 Mon Sep 17 00:00:00 2001 From: John Stachurski Date: Tue, 4 Aug 2026 05:01:23 +1000 Subject: [PATCH] heavy_tails: cite the Q-Q plot section rather than introduce it cold heavy_tails reached for sm.qqplot with only a Wikipedia link by way of explanation, having never said what a Q-Q plot is or how to read one. Now that fitting_distributions defines them, it cites that treatment and moves straight to the comparison it wants. Adds a (qq_plots)= label to the Q-Q plot section of fitting_distributions so the reference has something to point at. Also fixes a typo in the same paragraph: statsmodels compares sample data with the quantiles of the normal distribution, not the quintiles. And lower cases the heading per the style guide, which leaves the anchor unchanged. Co-Authored-By: Claude Opus 5 (1M context) --- lectures/fitting_distributions.md | 1 + lectures/heavy_tails.md | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lectures/fitting_distributions.md b/lectures/fitting_distributions.md index 52b20ad5..47ea2905 100644 --- a/lectures/fitting_distributions.md +++ b/lectures/fitting_distributions.md @@ -196,6 +196,7 @@ The other two look plausible. To choose between them we need something sharper than a glance at a figure. +(qq_plots)= ## Q-Q plots A **Q-Q plot** (short for quantile-quantile plot) compares two distributions by diff --git a/lectures/heavy_tails.md b/lectures/heavy_tails.md index e7c24a85..8d85d60a 100644 --- a/lectures/heavy_tails.md +++ b/lectures/heavy_tails.md @@ -650,11 +650,15 @@ We will use this idea [below](https://intro.quantecon.org/heavy_tails.html#heavy +++ -#### Q-Q Plots +#### Q-Q plots -We can also use a [qq plot](https://en.wikipedia.org/wiki/Q%E2%80%93Q_plot) to do a visual comparison between two probability distributions. +Another visual comparison is provided by the {ref}`Q-Q plot `, which we introduced in {doc}`fitting_distributions`. -The [statsmodels](https://www.statsmodels.org/stable/index.html) package provides a convenient [qqplot](https://www.statsmodels.org/stable/generated/statsmodels.graphics.gofplots.qqplot.html) function that, by default, compares sample data to the quintiles of the normal distribution. +There we compared a data set with a distribution fitted to it, and read the departures from the 45 degree line as a diagnosis of how the fit failed. + +Here we do the same with the normal distribution as the reference, since our interest is in how far these distributions depart from it. + +The [statsmodels](https://www.statsmodels.org/stable/index.html) package provides a convenient [qqplot](https://www.statsmodels.org/stable/generated/statsmodels.graphics.gofplots.qqplot.html) function that, by default, compares sample data with the quantiles of the normal distribution. If the data is drawn from a normal distribution, the plot would look like: