Description Usage Arguments Examples
it calculates the log-likelihood of a set of phylogenetic trees under the diversity-dependance model.
1 | llik.st(pars, setoftrees, impsam = F, correction = 0)
|
pars |
|
setoftrees |
|
impsam |
|
correction |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (pars, setoftrees, impsam = F, correction = 0)
{
m = length(setoftrees)
l = vector(mode = "numeric", length = m)
w = vector(mode = "numeric", length = m)
D = vector(mode = "numeric", length = m)
for (i in 1:m) {
s = setoftrees[[i]]
l[i] = llik(pars = pars, tree = s) + length(s$tree$wt) *
correction
w[i] = s$weight
D[i] = length(s$wt)
}
if (impsam) {
weight = exp(w - correction * D)/sum(exp(w - correction *
D))
l = l * weight
}
L = sum(l)
return(L)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.