From 3c3ae7dfde6a003cfc9a4dc450f675d65769a2e4 Mon Sep 17 00:00:00 2001 From: shlff Date: Fri, 17 Nov 2023 17:41:10 +1100 Subject: [PATCH] [mle] update units and labels --- lectures/mle.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lectures/mle.md b/lectures/mle.md index a88fb4bb..963597da 100644 --- a/lectures/mle.md +++ b/lectures/mle.md @@ -4,7 +4,7 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.14.5 + jupytext_version: 1.15.2 kernelspec: display_name: Python 3 (ipykernel) language: python @@ -102,8 +102,13 @@ Let's histogram this sample. ```{code-cell} ipython3 fig, ax = plt.subplots() -ax.set_xlim(-1,20) -ax.hist(sample, density=True, bins=5_000, histtype='stepfilled', alpha=0.8) +ax.set_xlim(-1, 20) +density, edges = np.histogram(sample, bins=5000, density=True) +prob = density * np.diff(edges) +plt.stairs(prob, edges, fill=True, alpha=0.8, label=r"unit: $\$100,000$") +plt.ylabel("prob") +plt.xlabel("net wealth") +plt.legend() plt.show() ``` @@ -502,7 +507,6 @@ ax.legend() plt.show() ``` - Clearly, this distribution is not a good fit for our data. ```{solution-end}