I have a question on Bayesian statistics. Let's consider a prior $\pi(\theta) \sim Un(\theta\mid10,20)$, where $\theta$ is an unknown weight and the problem is modelled $Un(x\mid\theta - \frac{1}{2},\theta + \frac{1}{2} )$. I want to find the posterior $\theta$ for a single value $x=12$.
My solution:
I know from first principles I am trying to use Bayes formula:
$$ \pi(\theta\mid x) = \frac{f(x\mid\theta) \times \pi(\theta) }{\pi(x)} $$ where,
- $\pi(\theta\mid x)$ : posterior
- $f(x\mid \theta)$: likelihood
- $\pi(\theta)$: prior
- $\pi(x)$: normalization constant.
So from $P(A\mid B) = \frac{P(B\mid A)P(B)}{P(A)}$ $$ \text{Posterior} = \frac{ \text{Likelihood} \times \text{Prior} }{\text{Normalization constant} } $$
In my case where $x=12$:
I think
- $\pi(\theta\mid x=12) = Un(\theta\mid 11.5, 12.5)$ for posterior
from
- $f(x\mid \theta) = 1 \,\forall \,\theta$: likelihood, since $f(x\mid \theta) = \prod^{n} Un(\theta - \frac{1}{2},\theta + \frac{1}{2}) =\frac{1}{1^{n}} = \frac{1}{1^{n}} = 1$
- $\pi(\theta) = \frac{1}{10}$: prior