By the end of this lecture, students should be able to:
Frequentist
The parameter is fixed and unknown. The fish doesn't move — we just observe what surfaces.
Position: a single fixed value, and the uncertainty is due to the bubbles rising.

Bayesian
The parameter itself has a distribution. The fish swims and leaves its own trail of data behind.
Position: The fish itself is moving and can be anywhere, governs by the density function.
| Question | Frequentist | Bayesian |
|---|---|---|
| What is the parameter? | Unknown and fixed | Unknown and uncertain |
| What is random? | Data | Parameter uncertainty \(\to\) data |
| Main tool | Likelihood | Bayes’ theorem |
| Main result | Point estimate (MLE) | Posterior distribution |
| Interval | Confidence interval | Credible interval |
| Prediction | Based on estimated parameters | Based on posterior uncertainty |
\[P(A\mid B)=\frac{P(B\mid A)P(A)}{P(B)}\]
where:

\[P(\color{blue}{D=1}\mid \color{red}{T=1}) = \frac{P(\color{red}{T=1}\mid \color{blue}{D=1})P(\color{blue}{\color{blue}{D=1}})}{P(\color{red}{T=1})}.\]

| Test | Sick | Healthy |
|---|---|---|
| Positive | 9,900 | 9,900 |
| Negative | 100 | 980,100 |
| Total | 10,000 | 1,000,000 |
\[\underbrace{p(\color{red}{\theta}\mid \color{blue}{x})}_{\text{Posterior}}=\frac{\overbrace{p(\color{blue}{x}\mid\color{red}{\theta})}^{\text{Likeihood}}\overbrace{p(\color{red}{\theta})}^{\text{Prior}}}{\underbrace{p(\color{blue}{x})}_{\text{How likely to observe data }\color{blue}{x}}}\propto p(\color{blue}{x}\mid\color{red}{\theta})p(\color{red}{\theta}).\]
Read more about Beta distribution on Wikipedia.
\[\underbrace{p(\color{red}{\theta}\mid \color{blue}{x})}_{\text{Posterior}}=\frac{\overbrace{p(\color{blue}{x}\mid\color{red}{\theta})}^{\text{Likeihood}}\overbrace{p(\color{red}{\theta})}^{\text{Prior}}}{\underbrace{p(\color{blue}{x})}_{\text{How likely to observe data }\color{blue}{x}}}\propto p(\color{blue}{x}\mid\color{red}{\theta})p(\color{red}{\theta}).\]
\[\begin{align*}p(\color{red}{\theta}\mid \color{blue}{x}=\color{green}{18})&\propto p(\color{blue}{x}=\color{green}{18}\mid\color{red}{\theta})p(\color{red}{\theta})\\ &= \left[\binom{30}{\color{green}{18}}\color{red}{\theta}^{\color{green}{18}}(1-\color{red}{\theta})^{12}\right][\color{red}{\theta}(1-\color{red}{\theta})]\\ &\propto \color{red}{\theta}^{19}(1-\color{red}{\theta})^{13}\\ &=\color{red}{\theta}^{\color{purple}{20}-1}(1-\color{red}{\theta})^{\color{purple}{14}-1}\\ \Rightarrow \underbrace{(\color{red}{\theta}\mid \color{blue}{x}=\color{green}{18})}_{\text{New belief of }\color{red}{\theta}}&\sim\color{purple}{\text{Beta}(\color{purple}{20},\color{purple}{14})}\quad (\color{purple}{\text{Posterior}}).\end{align*}\]
Given the observed data \(\color{blue}{x}\) and the prior \(p(\color{red}{\theta})\), there is a \(1-\color{red}{\alpha}\) posterior probability that \(\color{red}{\theta}\in[a,b]\).
\[\begin{align*}p(X_{new}=1\mid \color{blue}{x})&=\int_{0}^1\underbrace{p(X_{new}=1\mid \color{red}{\theta})}_{\text{Chance of head}}p(\color{red}{\theta}\mid \color{blue}{x})d\color{red}{\theta}\\ &=\int_{0}^1\color{red}{\theta}p(\color{red}{\theta}\mid \color{blue}{x})d\color{red}{\theta}\\ &=\mathbb{E}(\color{red}{\theta}\mid \color{blue}{x})=20/34=\color{green}{0.5882}.\end{align*}\]
| Likelihood | Prior | Posterior |
|---|---|---|
| Bernoulli/Binomial | Beta | Beta |
| Poisson | Gamma | Gamma |
| Normal mean with known variance | Normal | Normal |
| Multinomial | Dirichlet | Dirichlet |

\[ \boxed{ CI_{95\%} = [q_{0.025},q_{0.975}] } \]
Key idea:
Bootstrap approximates the sampling distribution without repeatedly collecting new datasets.



Suppose every model has prediction variance: \[\mathbb{V}(f_b)=\sigma^2\]
If models were independent: \[\mathbb{V}\left(\frac{1}{B}\sum_{b=1}^{B}f_b\right)=\frac{\sigma^2}{B}\]
Therefore: \(\boxed{B\uparrow\quad\Rightarrow\quad \text{Variance}\downarrow}\)
More models reduce variance, but correlation creates a variance floor.
🥳 Yeahhhh 🥂!!!
Let’s take a break!
