0
$\begingroup$

Suppose I have a normal distribution $X_i \sim N(\mu, \sigma)$ and I impose a uniform prior on the mean, so that it has to be positive. How do I go about finding the posterior distribution $p(\mu | X_i)$? Following the Bayesian formulas, we would have that $p(\mu | X_i) \propto \text{likelihood}.$ Does this mean that the posterior is the distribution of the normal likelihood? If so, how do I find this distribution?

$\sigma$ is known

$\endgroup$
3
  • 2
    $\begingroup$ Do you know the value of $\sigma$? If not, you would also need a prior on $\sigma$ to calculate this. $\endgroup$
    – fblundun
    Commented Mar 18, 2021 at 14:10
  • $\begingroup$ Yes I do - ill update the question $\endgroup$
    – Peter
    Commented Mar 18, 2021 at 14:18
  • $\begingroup$ The prior is either uniform or strictly positive. $\endgroup$
    – Bernhard
    Commented Mar 18, 2021 at 14:34

2 Answers 2

3
$\begingroup$

You still need to include the prior density in Bayes' rule; in this case the prior is proportionate to an indicator function over the range where the mean parameter is positive. The posterior would be a truncated normal distribution:

$$\pi(\mu | \mathbf{x}, \sigma) \propto \text{N}(\mu| \bar{x}, \sigma/n) \cdot \mathbb{I}(\mu > 0).$$

$\endgroup$
1
$\begingroup$

Saying "The distribution of the normal likelihood" is wrong, the normal likelihood is not distributed, what is distributed is $X$ and $\mu$. What you can say is that the posterior has the same form as the likelihood, up to a proportionality constant. Specifically, applying Bayes formula using a uniform prior on $\mu$ between $a$ and $b$ you get $p(\mu|X_i=x,\sigma) = N(x|\mu,\sigma) / \int_a^bN(x|\mu^\prime,\sigma)d\mu^\prime$. Using the limits $a=0$ and $b\to\infty$ that you need, the integral is $\int_0^\infty N(x|\mu^\prime,\sigma)d\mu^\prime = \frac{1}{2}(\textrm{erf}(\frac{x}{\sqrt{2}\sigma})+1)$. Normally, you don't even need to calculate that integral since it doesn't deppend on $\mu$. You can simply compute the integral of $p(\mu|X_i=x,\sigma)$ numerically and use it to normalize the distribution. Also, for estimating the MAP solution for $\mu$ (which in this case is also the maximum likelihood solution due to the uniform prior) you don't need to know the normalization.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.