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)
A phylogenetic tree of class aphylo.
Numeric vector of length 2. Misclasification probabilities. (see LogLike
).
Numeric vector of length 2. Gain/loss probabilities (see LogLike
).
Numeric vector of length 2. Annotation bias probabilities (see LogLike
).
Numeric scalar. Root node probability of having the function (see LogLike
).
Logical scalar. When FALSE
(default) the function
returns a list with a single scalar (the log-likelihood).
Logical scalar. When TRUE
(default) the function
checks the dimmension of the passed parameters.
A list of class phylo_LogLik
with the following elements:
An integer matrix of size \(2^p\times p\) as returned
by states
.
A numeric matrix of size \(G\times 2^p\) with node/state probabilities.
A numeric scalar with the log-likelihood value given the chosen parameters.
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.