Learn R Programming

CRABS (version 1.2.0)

crabs.loglikelihood: Compute likelihood

Description

Compute likelihood

Usage

crabs.loglikelihood(phy, model, rho = 1)

Value

the log-likelihood of the tree given the model

Arguments

phy

an object of class "phylo"

model

an object of class "CRABS"

rho

the taxon sampling fraction

Examples

Run this code
library(ape)
lambda <- function(t) exp(0.3*t) - 0.5*t
mu <- function(t) exp(0.3*t) - 0.2*t - 0.8
 
model <- create.model(lambda, mu, times = seq(0, 3, by = 0.005))

set.seed(123)
phy <- rcoal(25)

crabs.loglikelihood(phy, model)

Run the code above in your browser using DataLab