From e693e178d41064eb820473581d9dfd73da4908dc Mon Sep 17 00:00:00 2001 From: Allen Downey Date: Thu, 30 Nov 2023 11:32:03 -0500 Subject: [PATCH] Updating the notebooks --- notebooks/chap01.ipynb | 30 ++++++------ notebooks/chap02.ipynb | 8 ++-- notebooks/chap05.ipynb | 4 +- notebooks/chap06.ipynb | 104 ++++++++++++++++++++--------------------- 4 files changed, 73 insertions(+), 73 deletions(-) diff --git a/notebooks/chap01.ipynb b/notebooks/chap01.ipynb index 10c89633..e9e0b8eb 100644 --- a/notebooks/chap01.ipynb +++ b/notebooks/chap01.ipynb @@ -83,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:08.628591Z", @@ -118,7 +118,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:08.634488Z", @@ -131,7 +131,7 @@ "source": [ "import pandas as pd\n", "\n", - "gss = pd.read_csv('gss_bayes.csv', index_col=0)\n", + "gss = pd.read_csv('gss_bayes.csv')\n", "gss.head()" ] }, @@ -143,7 +143,7 @@ "\n", "The columns are\n", "\n", - "* `caseid`: Respondent id (which is the index of the table).\n", + "* `caseid`: Respondent identifier.\n", "\n", "* `year`: Year when the respondent was surveyed.\n", "\n", @@ -171,7 +171,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:09.085579Z", @@ -197,7 +197,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:09.100573Z", @@ -222,7 +222,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:09.108607Z", @@ -254,7 +254,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 10, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:09.115436Z", @@ -279,7 +279,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 11, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:09.121943Z", @@ -310,7 +310,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 12, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:09.133453Z", @@ -333,7 +333,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 13, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:09.138777Z", @@ -379,7 +379,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 14, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:09.144820Z", @@ -402,7 +402,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 15, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:09.150191Z", @@ -445,7 +445,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 16, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:09.156357Z", @@ -1658,7 +1658,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.12" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/notebooks/chap02.ipynb b/notebooks/chap02.ipynb index 9010713f..ec7ba527 100644 --- a/notebooks/chap02.ipynb +++ b/notebooks/chap02.ipynb @@ -290,12 +290,12 @@ "source": [ "I call the result `unnorm` because these values are the \"unnormalized posteriors\". Each of them is the product of a prior and a likelihood:\n", "\n", - "$$P(B_i)~P(D|B_i)$$\n", + "$$P(H_i)~P(D|H_i)$$\n", "\n", "which is the numerator of Bayes's Theorem. \n", "If we add them up, we have\n", "\n", - "$$P(B_1)~P(D|B_1) + P(B_2)~P(D|B_2)$$\n", + "$$P(H_1)~P(D|H_1) + P(H_2)~P(D|H_2)$$\n", "\n", "which is the denominator of Bayes's Theorem, $P(D)$.\n", "\n", @@ -819,7 +819,7 @@ "metadata": { "celltoolbar": "Tags", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -833,7 +833,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/notebooks/chap05.ipynb b/notebooks/chap05.ipynb index 44d3056d..5842fb91 100644 --- a/notebooks/chap05.ipynb +++ b/notebooks/chap05.ipynb @@ -1306,7 +1306,7 @@ "metadata": { "celltoolbar": "Tags", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1320,7 +1320,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/notebooks/chap06.ipynb b/notebooks/chap06.ipynb index a0e040f1..67da7313 100644 --- a/notebooks/chap06.ipynb +++ b/notebooks/chap06.ipynb @@ -902,7 +902,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 31, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:26.421840Z", @@ -982,7 +982,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 32, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:26.606680Z", @@ -1010,7 +1010,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 33, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:26.612684Z", @@ -1038,7 +1038,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 34, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:26.618422Z", @@ -1061,7 +1061,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 35, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:26.644030Z", @@ -1106,7 +1106,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 36, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:26.820717Z", @@ -1138,7 +1138,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 37, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:26.872557Z", @@ -1162,7 +1162,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 38, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:26.936312Z", @@ -1193,7 +1193,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 39, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.107058Z", @@ -1220,7 +1220,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 40, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.113201Z", @@ -1244,7 +1244,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 41, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.119898Z", @@ -1269,7 +1269,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 42, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.132181Z", @@ -1295,7 +1295,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 43, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.180198Z", @@ -1325,7 +1325,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 44, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.302382Z", @@ -1341,7 +1341,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 45, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.310142Z", @@ -1399,7 +1399,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 46, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.315665Z", @@ -1415,7 +1415,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 47, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.320891Z", @@ -1431,7 +1431,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 48, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.326406Z", @@ -1460,7 +1460,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 49, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.332446Z", @@ -1476,7 +1476,7 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 50, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.337763Z", @@ -1492,7 +1492,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 51, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.344018Z", @@ -1518,7 +1518,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 52, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.350794Z", @@ -1534,7 +1534,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 53, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.356825Z", @@ -1550,7 +1550,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 54, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.363702Z", @@ -1578,7 +1578,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 55, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.370205Z", @@ -1594,7 +1594,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 56, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.375761Z", @@ -1610,7 +1610,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 57, "metadata": {}, "outputs": [], "source": [ @@ -1619,7 +1619,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 58, "metadata": {}, "outputs": [], "source": [ @@ -1628,7 +1628,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 59, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.382061Z", @@ -1644,7 +1644,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 60, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.424920Z", @@ -1660,7 +1660,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 61, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.544172Z", @@ -1676,7 +1676,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 62, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.550649Z", @@ -1703,7 +1703,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 63, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.559242Z", @@ -1719,7 +1719,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 64, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.570896Z", @@ -1735,7 +1735,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 65, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.582633Z", @@ -1751,7 +1751,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 66, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.591475Z", @@ -1776,7 +1776,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 67, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.599975Z", @@ -1792,7 +1792,7 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 68, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.614916Z", @@ -1808,7 +1808,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 69, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.623276Z", @@ -1824,7 +1824,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 70, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.629708Z", @@ -1840,7 +1840,7 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 71, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.639970Z", @@ -1856,7 +1856,7 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 72, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.652015Z", @@ -1872,7 +1872,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 73, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.660241Z", @@ -1896,7 +1896,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 83, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:27.667020Z", @@ -1912,7 +1912,7 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 84, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:29.237941Z", @@ -1928,7 +1928,7 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 85, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:29.247538Z", @@ -1944,7 +1944,7 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 86, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:29.253937Z", @@ -1960,7 +1960,7 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 87, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:29.291044Z", @@ -1976,7 +1976,7 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": 88, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:29.407201Z", @@ -1992,7 +1992,7 @@ }, { "cell_type": "code", - "execution_count": 82, + "execution_count": 89, "metadata": { "execution": { "iopub.execute_input": "2021-04-16T19:35:29.415545Z", @@ -2017,7 +2017,7 @@ "metadata": { "celltoolbar": "Tags", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -2031,7 +2031,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.12" + "version": "3.10.12" } }, "nbformat": 4,