Learn R Programming

geiger (version 0.2-6)

likelihood.discrete: Likelihood for discrete character evolution

Description

Calculates the likelihood score for a set of discrete character data under a specified model

Usage

likelihood.discrete(phy, tip.data, q, delta=1, lambda=1, endf=1, break.point=0, f=1, rtt.rescale=0, total.rescale=F)

Arguments

phy
Phylogenetic tree
tip.data
Tip data
q
Instantaneous rate of change
delta
Tree scaling parameter
lambda
Tree scaling parameter
endf
Tree scaling parameter
break.point
Tree scaling parameter
f
Tree scaling parameter
rtt.rescale
Rescale root-to-tip distance?
total.rescale
Rescale total tree length?

Value

  • -loglnL

References

Felsenstein pruning

Examples

Run this code
data(geospiza)
attach(geospiza)
drop.tip(geospiza.tree, "olivacea")->g.tree

gb<-as.factor(geospiza.data[,1]>4.2)
names(gb)<-rownames(geospiza.data)

likelihood.discrete(g.tree, gb, q=1)
likelihood.discrete(g.tree, gb, q=1, delta=0.5)
likelihood.discrete(g.tree, gb, q=1, lambda=0.5)
likelihood.discrete(g.tree, gb, q=1, endf=0.5)
likelihood.discrete(g.tree, gb, q=1, break.point=0.5, endf=0.2)

Run the code above in your browser using DataLab