Description Usage Arguments Value Author(s) Examples
View source: R/likelihood_functions.R
it calculates the log-likelihood of a phylogenetic tree under the diversity-dependance model.
1 | llik(pars, tree)
|
pars |
Parameters corresponding to the diversity-dependance model |
tree |
phylogenetic tree described as the three vectors wt,E and n. |
log-likelihood value
F. Richter M.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## compare log likelihoods
#dd
tree = data.frame(brts=c(2,3,5,6),to=c(1,0,2,2),t_ext=c(3,Inf,Inf,Inf))
tree$n = sapply(tree$brts,n_from_time,tree=tree,soc=2)
pars = c(0.2,0.6,-0.005)
loglik.tree.rpd1(pars,tree)
loglik.tree.numerical(pars,tree,"rpd1")
## pd
tree$pd <- sapply(tree$brts, phylodiversity, tree=tree,soc=2)
pars = c(0.2,0.6,-0.01,0.01)
loglik.tree.rpd5c(pars,tree)
loglik.tree.numerical(pars,tree,"rpd5c")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.