Likelihood of an observed annotated phylogenetic tree
Likelihood of an observed annotated phylogenetic tree
This function computes the log-likelihood of the chosen parameters given a particular dataset. The arguments annotations, and offspring
should be as those returned by new_aphylo(). For complete parameter estimation see aphylo_estimates .
LogLike(tree, psi, mu_d, mu_s, eta, Pi, verb_ans =TRUE, check_dims =TRUE)
Arguments
tree: A phylogenetic tree of class aphylo .
psi: Numeric vector of length 2. Misclasification probabilities. (see LogLike).
mu_d, mu_s: Numeric vector of length 2. Gain/loss probabilities (see LogLike).
eta: Numeric vector of length 2. Annotation bias probabilities (see LogLike).
Pi: Numeric scalar. Root node probability of having the function (see LogLike).
verb_ans: Logical scalar. When FALSE (default) the function returns a list with a single scalar (the log-likelihood).
check_dims: Logical scalar. When TRUE (default) the function checks the dimmension of the passed parameters.
Returns
A list of class phylo_LogLik with the following elements: - S: An integer matrix of size 2p∗p as returned by states.
Pr: A numeric matrix of size G∗2p with node/state probabilities.
ll: A numeric scalar with the log-likelihood value given the chosen parameters.
Details
The parameters to estimate are described as follows:
psi: A vector of length 2 with psi[0] and psi[1], which are the misclassification probabilities fo s[p]=0 and s[p]=1
respectively.
mu_d, mu_s: A vector of length 2 with mu[0] and mu[1] which are the gain and loss probabilities respectively. The subscript d denotes duplication nodes and s speciation node.
eta: A vector of length 2 with eta[0] and eta[1] which are the annotation bias probabilities.
Pi: A numeric scalar which for which equals the probability of the root node having the function.