Next: Another approach to selecting
Up: Analyzing the genetic structure
Previous: Applying assignment to understand
In the documentation for Strucutre, Pritchard et al. provide a few
more suggestions on picking
. That ``thing'' I called ``Mean L(K)''
in Table 1 is the mean natural logarithm of the
probability of the data, given the unknown parameters. To give it a
mathematical formula
where
is the number of times we ran Structure for a particular
and
is the natural logarithm of the
probability of the data on the
th run.2 That quantity
should ring a bell. It looks a lot like a likelihood--probably
because it is (approximately) a likelihood, meaning that
is approximately the mean log
likelihood of the data.
So if we don't have any idea what
is, we might assume a uniform
prior, i.e., that all of the
we considered are a priori
equally likely. then by using Bayes' Theorem, we can calculate the
posterior probability of each
. For the Berberis thunbergii
data and
,
If you try to put a number like
into your
calculator, you're going to get a numerical overflow. So I used a
little re-scaling trick to do the calculation. Here's a function in R
that will do it for you:
K.post <- function(K, post) {
min.post <- min(post)
denominator <- sum(exp(post-min.post))
numerator <- exp(post[K] - min.post)
numerator/denominator
}
post is an array that contains the mean log probability of the
data for each
you're considering, in this case c(-2553.2,
-2331.9, -2402.0, -2476.3). K is the index of the
whose
posterior probability you want to calculate, in this case 1.3 So
putting this into R we get
> K.post(1, c(-2553.2, -2331.9, -2402.0, -2476.3))
[1] 7.77376e-97
Next: Another approach to selecting
Up: Analyzing the genetic structure
Previous: Applying assignment to understand
Kent Holsinger
2010-09-20