aphylo-model function

Formulas in aphylo

Formulas in aphylo

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.

eta(..., env) psi(..., env) Pi(..., env) mu_d(..., env) mu_s(..., env) aphylo_formula(fm, params, priors, env = parent.frame())

Arguments

  • ...: 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 model aphylo_formula(x ~ mu_d) # Mislabeling probabilities aphylo_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)
  • Maintainer: George Vega Yon
  • License: MIT + file LICENSE
  • Last published: 2024-12-03