Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lectures/fitting_distributions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions lectures/heavy_tails.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <qq_plots>`, 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:

Expand Down
Loading