Learn R Programming

TreePar (version 3.3)

LikDD: LikDD: Calculates the likelihood of speciation and extinction rates for an ultrametric phylogeny under a density-dependent speciation model conditioning on the age of the tree.

Description

LikDD calculates the likelihood of speciation and extinction rates for a phylogeny under a density-dependent speciation model. Speciation rate is a function of the number of species N, lambda(N) = max(0,lambda(1-N/K)), where K is the carying capacity and lambda the speciation rate when N<

Usage

LikDD(par,model=-1,x,Ndec=-1,minN=0,psi=0,sampling=1,root=0,ki=0,muset=0,vec=0)

Arguments

par
Parameters (lambda,mu,K) for which to calculate the likelihood: lambda is speciation rate, mu is extinction rate, and K is carrying capacity.
model
model = -1: speciation rate is lambda(N) = max(0,lambda(1-N/K)). model = 0: speciation rate is lambda(N) = lambda for N <= k,="" und="" lambda(n)="0" for="" n="">K.
x
Vector of speciation times and ancient lineage sampling times in the phylogeny. Time is measured increasing going into the past with the present being time 0. x can be obtained from a phylogenetic tree using getx(TREE).
Ndec
Help variable when optimizing.
minN
Help variable when optimizing.
psi
Rate for sampling lineages through time.
sampling
Probabiliy to sample a present day lineage.
root
If root = 1 then max(x) is the mrca (crown age), if root = 0 then max(x) is the age of a branch ancestral to the mrca (stem age).
ki
Help variable when optimizing.
muset
Help variable when optimizing.
vec
vec=0 returns likelihood of model parameters for a tree given 1 lineage at beginning. vec=1 returns vector of likelihoods given i lineages at beginning.

Value

res
-log likelihood of the parameters given the tree.

References

R.S. Etienne, B. Haegeman, T. Stadler, T. Aze, P.N. Pearson, A. Purvis, A.B. Phillimore. Diversity-dependence brings molecular phylogenies closer to agreement with the fossil record. Proc. Roy. Soc. B, 279: 1300-1309, 2012.

G. Leventhal, H. Guenthard, S. Bonhoeffer, T. Stadler. Using an epidemiological model for phylogenetic inference reveals density-dependence in HIV transmission. Mol. Biol. Evol., 31(1): 6-17, 2014.

Examples

Run this code
# see manual of LikShifts()

Run the code above in your browser using DataLab