# 应用贝叶斯方法|  Applied Bayesian Methods代写STAT0031代考

0

A random variable $X \in \mathbb{R}$ has a normal $\left(\theta, \sigma^{2}\right)$ distribution if $\sigma^{2}>0$ and
$$p\left(x \mid \theta, \sigma^{2}\right)=\frac{1}{\sqrt{2 \pi \sigma^{2}}} e^{-\frac{1}{2}(x-\theta)^{2} / \sigma^{2}} \quad \text { for }-\infty<x<\infty$$

For this distribution,
\begin{aligned} \mathrm{E}\left[X \mid \theta, \sigma^{2}\right] &=\theta, \ \operatorname{Var}\left[X \mid \theta, \sigma^{2}\right] &=\sigma^{2} \ \operatorname{mode}\left[X \mid \theta, \sigma^{2}\right] &=\theta \ p\left(x \mid \theta, \sigma^{2}\right) &=\operatorname{dnorm}(x, \text { theta,sigma }) \end{aligned}

## PHAS00030 COURSE NOTES ：

This condition implies that our density for $\theta$ must be the uniform density:
$$p(\theta)=1 \text { for all } \theta \in[0,1]$$
For this prior distribution and the above sampling model, Bayes’ rule gives
\begin{aligned} p\left(\theta \mid y_{1}, \ldots, y_{129}\right) &=\frac{p\left(y_{1}, \ldots, y_{129} \mid \theta\right) p(\theta)}{p\left(y_{1}, \ldots, y_{129}\right)} \ &=p\left(y_{1}, \ldots, y_{129} \mid \theta\right) \times \frac{1}{p\left(y_{1}, \ldots, y_{129}\right)} \ & \propto p\left(y_{1}, \ldots, y_{129} \mid \theta\right) \end{aligned}