I am having trouble understanding a basic Bayesian inference exercise:

Suppose we are interested in inferring the proportion $\theta$ of individuals in a given population suffering from a certain disease. A group of epidemiologists initially determined that this prevalence can be:

  • Low $(C_1: \ \theta = 0.10)$
  • Medium $(C_2:\ \theta = 0.50)$
  • High $(C_3:\ \theta = 0.75)$

and that $\mathbb{P}(C_1) = 0.4$, $\mathbb{P}(C_2) = 0.20$ and $\mathbb{P}(C_3) = 0.40$.

Subsequently, the epidemiologists had access to a random sample of 100 individuals from that population, in which they observed that 27 of them had the disease. Given this information, what is the probability that the prevalence is now low?

My attempt:

To solve the problem I tried to simply use Bayes' theorem, considering the event $D:$ the person is sick. So for me it was simply to look at it as follows:

$$\mathbb{P}[C_1 \vert D] = \dfrac{\mathbb{P}[D\vert C_1]\cdot \mathbb{P}[C_1]}{\mathbb{P}[D]} = \dfrac{\theta \cdot 0.4}{0.27} = \dfrac{0.1 \times 0.4}{0.27} \approx 0.15 $$

Therefore concluded that the probability that the prevalence of the disease is low was 0.15.

Thinking that I had got it right, I decided to take out the probabilities of medium and high prevalence respectively, but I ran into a problem when calculating the high prevalence:

$$\mathbb{P}[C_3 \vert D] = \dfrac{\mathbb{P}[D\vert C_3]\cdot \mathbb{P}[C_3]}{\mathbb{P}[D]} = \dfrac{\theta \cdot 0.4}{0.27} = \dfrac{0.75 \times 0.4}{0.27} \approx 1.11 \ !! $$

My first thought was that the wrong data I was using was to use that the probability of the disease is 0.27 and I proceeded to calculate it using the law of total probability:

$$\mathbb{P}[D] = \sum_{i=1}^{3} \mathbb{P}[D\vert C_i]\cdot \mathbb{P}[C_i] = 0.44$$


$$\mathbb{P}[C_1 \vert D] = \dfrac{0.1 \times 0.4}{0.44} \approx 0.09 $$

However, here I understand that I am also doing something wrong, as I am not using the information provided to me from the observed data.

Looking at some examples, I understand that to find the probability I want, it is not as simple as what I am proposing, since I need to define a prior distribution and a likelihood.

Guided by the same steps as some examples, I established that I could propose that $\theta \sim Beta(0.1,0.9)$ as a prior distribution, since $\mathbb{E}[\theta] = 0.1$ (for the low prevalence case). And, using that 27 out of 100 people in the sample are sick, I thought of proposing a binomial likelihood, using $n=100$ and $k=27$.

Making use of that, it is intuitive for me to conclude, however, I realize that by doing this procedure, at no point do I use the information that $\mathbb{P}[C_1] = 0.4$.

The idea I have is that the error would be to assume a binomial likelihood, taking into account that we have 3 different scenarios: high, medium and low prevalence. So intuitively I think in that case I should use a multinomial distribution for the likelihood, but I think that complicates things too much to be able to find a posterior distribution.

I am really confused with this exercise, to the point of doubting whether I am interpreting correctly that what the exercise asks for is to find $\mathbb{P}[C_1 \vert D]$. I would appreciate any help to be able to state the exercise correctly.


2 Answers 2


We can just apply Bayes' Theorem.

$$\mathbb{P}(\text{low}|27) = \frac{\mathbb{P}(27|\text{low}) \cdot \mathbb{P}(\text{low})}{\mathbb{P}(27)} $$$$=\frac{\binom{100}{27} (0.1)^{27} (0.9)^{73}\cdot (0.4)}{\binom{100}{27} (0.1)^{27} (0.9)^{73}\cdot (0.4) + \binom{100}{27} (0.5)^{27} (0.5)^{73}\cdot (0.2) + \binom{100}{27} (0.75)^{27} (0.25)^{73}\cdot (0.4)} $$$$= \frac{(0.1)^{27}(0.9)^{73}\cdot (0.4)}{(0.1)^{27}(0.5)^{73}\cdot (0.4) + (0.5)^{27}(0.9)^{73}\cdot (0.2) + (0.75)^{27}(0.25)^{73}\cdot (0.4)} $$$$\approx 53.7 \text{%}.$$


It's still a binomial likelihood because your data have only two possible outcomes (diseased or not diseased). Rather, it's your prior distribution on $\theta$ that is to be multinomial/categorical. The Beta distribution is commonly used with the binomial likelihood but is unrelated to this problem.

To be precise, the prior distribution on the binomial success probability parameter $\theta$ is the categorical distribution on [0.1, 0.5, 0.75] with probabilities P(C1), P(C2), P(C3).

You're also calculating the binomial probabilities wrong. It's not just the proportion of diseased in the sample, you need to use the formula:

$$ {n\choose k} \theta^k(1-\theta)^{n-k}$$

where $n=100$ and $k=27$ in your case.


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.