2 Bayesian statistics 331-Week 2

2.3 The evidence for the model

The role of the marginal likelihood

The marginal likelihood, m(y)=f(y), (the denominator in Bayes theorem) is used by Bayesian for the purpose of model comparison. It is also known as the evidence in favour of the model. For model selection classical statisticians use measures of fit penalized by a measure of complexity. The marginal likelihood automatically does this. It uses the principle of Occam’s Razor to penalise large models.

The marginal likelihood or evidence

f(yM) =m(y)
=θf(y|θ)π(θ)𝑑θ

2.3.1 Evidence in favour of a model

The marginal likelihood

  1. 1.

    Complex models with more parameters fit better and have a higher likelihood.

  2. 2.

    However complex models can predict poorly. Occam’s razor applies to prediction.

  3. 3.

    The marginal likelihood penalises the fit by a measure of complexity

Figure 2.1: Link, Caption: The dashed line represents the likelihood and the solid line is the marginal likelihood. With increasing model complexity, the likelihood continually increases, whereas the marginal likelihood has a maximum at some point, after which it begins to decrease.

How the marginal likelihood works

Using Bayes theorem the posterior is

p(θY,M)=p(yθ,M)p(θM)p(yM)

Rewriting this with the marginal likelihood as the subject we get

p(yM)=p(yθ,M)p(θM)p(θy,M)

Writing this in log form we have

logp(yM) =logp(yθ,M)log-likelihood-(logp(θy,M)-logp(θM)penalty)
-2logp(yM) =Deviance+2Penalty

This is true for any θ including the MLE. logp(yθ,M) increases with model complexity as does the penalty.

2.3.2 Binomial observation and a beta prior

Binomial observation and a beta prior

m(y) =(ny)π=01πy(1-π)n-yπp-1(1-π)q-1𝑑πB(p,q)
m(y) =(ny)B(y+p,n-y+q)B(p,q)

This is the Beta-binomial distribution.

yBeta-Binomial (n,p+y,q+n-y)

which has more variation than the binomial.

Figure 2.2: Link, Caption:

2.3.3 Poisson observation and a gamma prior

Poisson observation and a gamma prior

m(y) = θ=0f(y|θ)π(θ)𝑑θ
= θ=01y!e-θθyqpΓ(p)θp-1e-qθ
= qpΓ(p)y!θ=0θy+p-1e-θ(q+1)
= qpy!Γ(p)Γ(y+p)(q+1)y+p
= qpy!Γ(p)Γ(y+p)(q+1)y+p
(qq+1)p(1q+1)y
yNegative-Binomial (p,qq+1)

The long tail of the marginal likelihood

Figure 2.3: Link, Caption: The diagram compares the Poisson and the negative-binomial distribution. The negative-binomial can have more variation than the Poisson

The marginal likelihood and Bayes factors

  1. 1.

    Bayesian inference is obtained by updating our belief in a parameter by multiplying our current belief by the likelihood of the current observation(s) and then normalising. This yields the posterior distribution which can become the prior for the next observation.

  2. 2.

    Updating belief in a model is no different, in principle, to updating a parameter.

  3. 3.

    The marginal likelihood is the denominator in Bayes theorem.

  4. 4.

    The ratio of marginal likelihoods give us a Bayes factor which compares the weight of evidence in favour of two given models.

    BF2,1=P(y1)P(y2)
  5. 5.

    Bayes model selection is coherent and uses only the laws of probability.

Example

A coin is tossed 10 times resulting in 9 heads and one tail. The question of interest is whether the coin is biased or not. The null hypothesis, Ho, is that the coin is fair, (π=1/2), with the alternative hypothesis, Ha, is that the coin is biased (π1/2).

  1. (i)

    Define the p-value used in classical hypothesis testing. What is the implication of a low p-value?

  2. (ii)

    Use a classical hypothesis test to test whether the coin is fair with a 5% significance level.

  3. (iii)

    If I assume (before the experiment) that each hypothesis is equally likely, calculate the Bayes Factor for Ha relative to Ho (If necessary state any further assumptions that you might need to make).

  4. (iv)

    What is the probability that the coin is biased?

Answer

  1. (i)

    A p-value is the probability of getting a test statistic at least as extreme as that observed under the null hypothesis by pure chance. A low p-value is evidence against the null hypothesis.

  2. (ii)

    p(X{9,10})=0.510+10*0.510=0.01074. The test is two tailed. Therefore the p- value is 2×0.010740.02
    Since p<.05 Reject Ho in favour of Ha with 95% certainty.

  3. (iii)

    If we assume that under Ha, πBeta (α,β) where α=β=1. The normalize constant for the binomial is k=10

    p(yH0)P(yHa) =k×0.510p(yπ)P(π)𝑑π
    =k×0.510k×𝐁(y+α,n-y+β)
    =0.1074

Answer

  1. (iv)

    Therefore if P(Ho)=p(Ha) then

    1-p(Ha)p(Ha)=0.1074

    p(Ha)=11+0.1074=0.903 [4]