# What is the posterior probability of $H_0$?

Exercise: Assume that $\Theta$ is a random variable that takes values in $\Omega = \{0,1\}$ and consider the random variable $X$ that has the following probability mass function, conditional on $\Theta$,

$$Pr(X = -1|\Theta = 0) = Pr(X = 0|\Theta = 0) = Pr(X = 1| \Theta = 0) = 1/3\\Pr(X = -1 |\Theta = 1) = Pr(X = 1|\Theta = 1) = 1/4,\,Pr(X = 0|\Theta = 1) = 1/2.$$

Suppose that we want to test $H_0: \Theta = 0$ vs $H_1: \Theta = 1$ and suppose that the prior probability of $H_0$ equals $2/3$ and that $x = 0$ is observed. What is the posterior probability of $H_0$?

What I've tried: Let $\Pi(\Omega_0)$ be the prior probability that hypothesis $H_0$ is true. Furthermore, $f_\Theta^{(0)}$ is the prior probability conditional on hypothesis $H_0$. Then, the posterior probability of $H_0$ equals $$\mathbb{P}(\Omega_0|X) = \dfrac{\int_{\Omega_0}f_{X|\Theta}(x|\theta)\,f_\Theta^{(0)}(\theta)d\nu(\theta)}{f_X(x)} = \dfrac{\Pi(\Omega_0)}{f_X(x)}\int_{\Omega_0}f_{X|\Theta}(x|\theta)\,f_\Theta^{(0)}(\theta)d\nu(\theta)$$ I'm not sure how to proceed however. I know that $\Pi(\Omega_0) = 2/3$ but I don't know what $f_X$ is or what $f_\Theta^{(0)}$ is.

Question: How do I solve this exercise?

• You have given two different values for $\Pr[X = -1 \mid \Theta = 1]$ in your question. – heropup Jan 22 '18 at 8:18
Don't let excessive notation get in the way of what is really a straightforward application of Bayes' theorem. $$\Pr[H_0 \mid X = 0] = \Pr[\Theta = 0 \mid X = 0] = \frac{\Pr[X = 0 \mid \Theta = 0] \Pr[\Theta = 0]}{\Pr[X = 0]}.$$ Then by the law of total probability, $$\Pr[X = 0] = \Pr[X = 0 \mid \Theta = 0]\Pr[\Theta = 0] + \Pr[X = 0 \mid \Theta = 1]\Pr[\Theta = 1].$$ Note of course, we are supplied $\Pr[\Theta = 0] = 2/3$, thus $\Pr[\Theta = 1] = 1 - \Pr[\Theta = 0] = 1/3$. We are also given the other conditional probabilities as posed in the question.
You have discrete unknown $\Theta$ and discrete observable $X$, so to get the posterior distribution you need to apply the Bayes rule in a form $$p_{\Theta|X}(\theta|x)=\frac{p_{X|\Theta}(x|\theta)p_{\Theta}(\theta)}{p_X(x)}$$ where $$p_X(x)=\sum_{\theta'}{p_{X|\Theta}(x|\theta')}p_{\Theta}(\theta')$$ You just need to calculate the posterior distribution for the given observation result $x=0$.