This function the the workhorse behind the likelihood function. It creates arbitrary models by modifying the call to LogLike() function according to what the user specifies as model.
...: Either 0, 1 or both. Depending on the parameter, the index of the model parameter that will be set as fixed.
env: Environment (not to be called by the user).
fm: A formula. Model of the type <aphylo-object> ~ <parameters> (see examples).
params: Numeric vector with model parameters.
priors: (optional) A function. Prior for the model.
Returns
A list with the following elements:
fun A function. The log-likelihood function.
fixed Logical vector.
Examples
set.seed(12)x <- raphylo(10)# Baseline modelaphylo_formula(x ~ mu_d)# Mislabeling probabilitiesaphylo_formula(x ~ mu_d + psi)# Different probabilities for speciation and duplication node# (only works if you have both types)aphylo_formula(x ~ mu_d + mu_s + psi)# Mislabeling probabilities and etas(fixed)aphylo_formula(x ~ mu_d + psi + eta(0,1))# Mislabeling probabilities and Pi aphylo_formula(x ~ mu_d + psi + Pi)