View source: R/likelihood_bdK.R
likelihood_bdK | R Documentation |
Computes the log likelihood of a rooted ultrametric phylogeny under a constant-time homogeneous birth-death model and k-sampling. The birth-death process is conditioned on the starting time of the process tottime
and the survival of the process at present time as well as having k extant sampled tips at present. This function can computes the log likelihood on a stem or crown phylogeny. This function is specifically adapted for diversification analysis on phylogenies on which the sampling probability is unknown.
likelihood_bdK( tottime, nbtips, tj, root, dt = dt, rel.tol = rel.tol, tuned_dichotomy = tuned_dichotomy, brk = brk )
tottime |
Numeric vector. The stem or crown age (also called MRCA) of the phylogeny depending on the conditioning of the process specified (see |
nbtips |
Integer. The number of extant sampled tips in the phylogeny typically noted |
tj |
List of numeric vector. A list of atomic numeric vector where the vector is specifying the node depths of the phylogeny. The list is of length 1. The node depths of a phylogeny can be computed using |
root |
Integer. Specifying the conditioning of the birth-death process. |
dt |
Numeric. If |
rel.tol |
Numeric. This represents the relative accuracy requested when the integral is performed using |
tuned_dichotomy |
Logical. If |
brk |
Numeric. The number of steps used in the dichotomy search. Typically the value 200 is sufficient to avoid non finite values. In some case if the log likelihood is still equal to non finite value, the |
This function is a closure, it takes all of the above as arguments and creates another function using the arguments described in the Value
section. Note that when the phylogeny is in stem, the conditioning is done on the stem age and k number of extant tips while when the phylogeny is in crown, the conditioning is done on the crown age, k_1 and k_2 the number of extant tips of the sister clades diverging at the MRCA. This function is specifically intended to be used on phylogenies with unknown or highly uncertain global diversity estimates (the sampling probability is not known with accuracy). Note that the sampling probability is never estimated and that this function is not able to evaluate negative rates.
Returns an object of class function
. This function can take the following arguments (tun.init
and seqphy.init
) and will return another function. This last function will take the diversifications rate as arguments ((div
and turn
)) and will return the value of the log likelihood in a list together with the tuning parameter value used:
Numeric The initial tuning parameter value. Typically, it will take the value log(1).
Integer. Here seqphy.init = 1
since it is the likelihood of a single phylogeny that is computed.
Numeric. The net diversification rate also called r.
Numeric. The turnover rate also called ε.
Note that this functioon can be used on a set of phylogenies. See likelihood_bdRho
to check how to adapt the arguments for a set of phylogenies.
Sophia Lambert
fitMCMC_bdK
and likelihood_bdRho
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.