8.4: Using Bayesian MCMC to estimate parameters of the Mk model
We can also analyze this model using a Bayesian MCMC framework. We can modify the standard approach to Bayesian MCMC (see chapter 2):
-
Sample a starting parameter value,
q
, from its prior distributions. For this example, we can set our prior distribution as uniform between 0 and 1. (Note that one could also treat probabilities of states at the root as a parameter to be estimated from the data; in this case we will assign equal probabilities to each state).
-
Given the current parameter value, select new proposed parameter values using the proposal density
Q
(
q
′|
q
). For example, we might use a uniform proposal density with width 0.2, so that
Q
(
q
′|
q
)
U
(
q
− 0.1,
q
+ 0.1).
-
Calculate three ratios:
-
a. The prior odds ratio,
R
p
r
i
o
r
. In this case, since our prior is uniform,
R
p
r
i
o
r
= 1.
-
b. The proposal density ratio,
R
p
r
o
p
o
s
a
l
. In this case our proposal density is symmetrical, so
R
p
r
o
p
o
s
a
l
= 1.
-
c. The likelihood ratio,
R
l
i
k
e
l
i
h
o
o
d
. We can calculate the likelihoods using Felsenstein’s pruning algorithm (Box 8.1); then calculate this value based on equation 2.26.
-
a. The prior odds ratio,
R
p
r
i
o
r
. In this case, since our prior is uniform,
R
p
r
i
o
r
= 1.
-
Find
R
a
c
c
e
p
t
as the product of the prior odds, proposal density ratio, and the likelihood ratio. In this case, both the prior odds and proposal density ratios are 1, so
R
a
c
c
e
p
t
=
R
l
i
k
e
l
i
h
o
o
d
-
Draw a random number
u
from a uniform distribution between 0 and 1. If
u
<
R
a
c
c
e
p
t
, accept the proposed value of both parameters; otherwise reject, and retain the current value of the two parameters.
-
Repeat steps 2-5 a large number of times.
We can run this analysis on our squamate data, obtaining a posterior with a mean estimate of q = 0.001980785 and a 95% credible interval of 0.001174813 − 0.003012715.