Skip to content

Commit d32ed07

Browse files
authored
Merge pull request #21 from RuiDongDR/main
fix small typos
2 parents b6bceaf + c4a9770 commit d32ed07

File tree

6 files changed

+13
-38
lines changed

6 files changed

+13
-38
lines changed

Bayesian_model_comparison.ipynb

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -53,42 +53,13 @@
5353
"cell_type": "markdown",
5454
"id": "f5aa6a8c",
5555
"metadata": {},
56-
"source": [
57-
"# Technical Details\n",
58-
"\n",
59-
"## Bayes Factor\n",
60-
"\n",
61-
"Recall in [Lecture: Bayes factor](https://statfungen.github.io/statgen-primer/Bayes_factor.html), we learn that the **Bayes factor** quantifies the relative evidence data provides for competing models:\n",
62-
"\n",
63-
"$$\n",
64-
"\\text{BF}_{21} = \\frac{L(\\text{M}_2|\\text{D})}{L(\\text{M}_1|\\text{D})} ={\\frac {\\int \\Pr(\\theta_{2}|M_{2})\\Pr(D|\\theta_{2},M_{2})\\,d\\theta _{2}}{\\int \\Pr(\\theta_{1}|M_{1})\\Pr(D|\\theta_{1},M_{1})\\,d\\theta _{1}}}\n",
65-
"$$\n",
66-
"\n",
67-
"**Interpretation**: \n",
68-
"- $\\text{BF}_{21} > 1$: Data favors $\\text{M}_2$ over $\\text{M}_1$\n",
69-
"- $\\text{BF}_{21} < 1$: Data favors $\\text{M}_1$ over $\\text{M}_2$\n",
70-
"- $\\text{BF}_{21} = 1$: Data uninformative for model choice\n"
71-
]
56+
"source": "# Technical Details\n\n## Bayes Factor\n\nRecall in [Lecture: Bayes factor](https://statfungen.github.io/statgen-primer/Bayes_factor.html), we learn that the **Bayes factor** quantifies the relative evidence data provides for competing models:\n\n$$\n\\text{BF}_{12} = \\frac{L(\\text{M}_1|\\text{D})}{L(\\text{M}_2|\\text{D})} ={\\frac {\\int \\Pr(\\theta_{1}|M_{1})\\Pr(D|\\theta_{1},M_{1})\\,d\\theta _{1}}{\\int \\Pr(\\theta_{2}|M_{2})\\Pr(D|\\theta_{2},M_{2})\\,d\\theta _{2}}}\n$$\n\n**Interpretation**: \n- $\\text{BF}_{12} > 1$: Data favors $\\text{M}_1$ over $\\text{M}_2$\n- $\\text{BF}_{12} < 1$: Data favors $\\text{M}_2$ over $\\text{M}_1$\n- $\\text{BF}_{12} = 1$: Data uninformative for model choice\n"
7257
},
7358
{
7459
"cell_type": "markdown",
7560
"id": "649cf697",
7661
"metadata": {},
77-
"source": [
78-
"## Posterior Odds\n",
79-
"\n",
80-
"The Bayes factor updates prior beliefs about models:\n",
81-
"\n",
82-
"$$\n",
83-
"\\frac{P(\\text{M}_2|D)}{P(\\text{M}_1|D)} = \\text{BF}_{21} \\times \\frac{P(\\text{M}_2)}{P(\\text{M}_1)}\n",
84-
"$$\n",
85-
"\n",
86-
"This shows how conditioning on data transforms our uncertainty:\n",
87-
"\n",
88-
"$$\n",
89-
"\\text{Posterior Uncertainty} = \\text{Evidence Update} \\times \\text{Prior Uncertainty}\n",
90-
"$$"
91-
]
62+
"source": "## Posterior Odds\n\nThe Bayes factor updates prior beliefs about models:\n\n$$\n\\frac{P(\\text{M}_1|D)}{P(\\text{M}_2|D)} = \\text{BF}_{12} \\times \\frac{P(\\text{M}_1)}{P(\\text{M}_2)}\n$$\n\nThis shows how conditioning on data transforms our uncertainty:\n\n$$\n\\text{Posterior Uncertainty} = \\text{Evidence Update} \\times \\text{Prior Uncertainty}\n$$"
9263
},
9364
{
9465
"cell_type": "markdown",

Bayesian_normal_mean_model.ipynb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"cell_type": "markdown",
2323
"id": "bd95d8b1",
2424
"metadata": {},
25-
"source": "![Fig](./graphical_summary/slides/Slide27.png)"
25+
"source": [
26+
"![Fig](./graphical_summary/slides/Slide27.png)"
27+
]
2628
},
2729
{
2830
"cell_type": "markdown",
@@ -115,7 +117,7 @@
115117
"source": [
116118
"## Posterior Distribution\n",
117119
"\n",
118-
"Using Bayes' theorem, we update our uncertainty given the observed data:\n",
120+
"Using Bayes' rule, we update our uncertainty given the observed data:\n",
119121
"\n",
120122
"$$\n",
121123
"p(\\beta|\\mathbf{Y}) \\propto p(\\mathbf{Y}|\\beta) \\cdot p(\\beta)\n",
@@ -150,7 +152,7 @@
150152
"where $w = \\frac{T_1/\\sigma^2}{T_1/\\sigma^2 + 1/\\sigma_0^2}$, $\\hat{\\beta}_{\\text{data}} = T_2/T_1$, and $T_1 = \\sum_{i=1}^N X_i^2$, $T_2 = \\sum_{i=1}^N X_i Y_i$.\n",
151153
"\n",
152154
"**Interpretation**:\n",
153-
"- More data or lower noise → $w \\approx 1$ (trust data)\n",
155+
"- More data or lower noise (small $\\sigma^2$) → $w \\approx 1$ (trust data)\n",
154156
"- Vague prior (large $\\sigma_0^2$) → $w \\approx 1$ (data dominates)\n",
155157
"- Strong prior (small $\\sigma_0^2$) → $w \\approx 0$ (prior dominates)"
156158
]
@@ -619,4 +621,4 @@
619621
},
620622
"nbformat": 4,
621623
"nbformat_minor": 5
622-
}
624+
}
2.82 KB
Loading

figures/multiple_testing.png

1.28 KB
Loading

figures/p_value.png

445 Bytes
Loading

p_value_and_Bayesian_hypothesis_testing.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"source": [
88
"# $p$-value and Bayesian Hypothesis Testing\n",
99
"\n",
10-
"In hypothesis testing, frequentists generally use *p*-value to evaluate the evidence against the null hypothesis;*Bayesian hypothesis testing, however, directly computes the probability of any hypothesis given observed data."
10+
"In hypothesis testing, frequentists generally use *p*-value to evaluate the evidence against the null hypothesis; Bayesian hypothesis testing, however, directly computes the probability of any hypothesis given observed data."
1111
]
1212
},
1313
{
@@ -22,7 +22,9 @@
2222
"cell_type": "markdown",
2323
"id": "d470175e",
2424
"metadata": {},
25-
"source": "![Fig](./graphical_summary/slides/Slide26.png)"
25+
"source": [
26+
"![Fig](./graphical_summary/slides/Slide26.png)"
27+
]
2628
},
2729
{
2830
"cell_type": "markdown",
@@ -1248,4 +1250,4 @@
12481250
},
12491251
"nbformat": 4,
12501252
"nbformat_minor": 5
1251-
}
1253+
}

0 commit comments

Comments
 (0)