2
$\begingroup$

I'm reading this online book and there is something unclear to me in this table where the posterior probability of each model computed as:

$$\ P(model \ | \ data) = \frac{P(data \ | \ model) \times P(model)}{P(data) } $$

I understand $\ P(model) $ is a prior, and $\ P(data \ | model ) $ is just a binomial (probability of observing such data given the prior) distribution but what exactly is $\ P(data) $ ?

$\endgroup$

2 Answers 2

2
$\begingroup$

It's just a normalizing constant which makes the posterior a valid density. In practice, we don't care so much about it. It should be noted that

$$p(x) = \int p(x\vert \theta) p(\theta) \, d\theta$$

So it is as if you are averaging the likelihood over the prior.

$\endgroup$
3
  • $\begingroup$ Ok so is it as if I would say that $\ P(model | data) $ proportional to $\ P(data | model) \times P(model) $ ? If i understand correctly then I just take the $\ P(data \ | \ model) \times \ P(model) $ and divide it by the sum of all $\ P(data | model)P(model( $ to get the posterior probability of each? $\endgroup$
    – bm1125
    Commented Jan 16, 2020 at 16:56
  • 1
    $\begingroup$ That's right. Often times, we just write bayes rule as a proportionality rather than an equality because the normalizing constant can be tricky to compute. $\endgroup$ Commented Jan 16, 2020 at 16:58
  • $\begingroup$ Thanks a lot Demetri! $\endgroup$
    – bm1125
    Commented Jan 16, 2020 at 17:01
1
$\begingroup$

I agree with @Demetri. Baysian inference is based on cause and effect relationship.
$P(effect|cause)$ is usually known. Therefore we try to infer $P(cause|effect)$.

Remember effect is observable, hence we try to infer the cause given the effect.

$P(data)$ is just a normalizing factor which is total $P(cause)$.

$\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.