Skip to content

Commit

Permalink
Updating the notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenDowney committed Nov 30, 2023
1 parent 4f241bb commit e693e17
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 73 deletions.
30 changes: 15 additions & 15 deletions notebooks/chap01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:08.628591Z",
Expand Down Expand Up @@ -118,7 +118,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 6,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:08.634488Z",
Expand All @@ -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()"
]
},
Expand All @@ -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",
Expand Down Expand Up @@ -171,7 +171,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 7,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:09.085579Z",
Expand All @@ -197,7 +197,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 8,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:09.100573Z",
Expand All @@ -222,7 +222,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 9,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:09.108607Z",
Expand Down Expand Up @@ -254,7 +254,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 10,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:09.115436Z",
Expand All @@ -279,7 +279,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 11,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:09.121943Z",
Expand Down Expand Up @@ -310,7 +310,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 12,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:09.133453Z",
Expand All @@ -333,7 +333,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 13,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:09.138777Z",
Expand Down Expand Up @@ -379,7 +379,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 14,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:09.144820Z",
Expand All @@ -402,7 +402,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 15,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:09.150191Z",
Expand Down Expand Up @@ -445,7 +445,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 16,
"metadata": {
"execution": {
"iopub.execute_input": "2021-04-16T19:35:09.156357Z",
Expand Down Expand Up @@ -1658,7 +1658,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions notebooks/chap02.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -819,7 +819,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -833,7 +833,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions notebooks/chap05.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -1320,7 +1320,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit e693e17

Please sign in to comment.