tess.likelihood.ebdstp: tess.likelihood.ebdstp

Description Usage Arguments Value Examples

View source: R/tess.likelihood.ebdstp.R

Description

Computation of the likelihood for a given tree under an episodic fossilized-birth-death model (i.e. piecewise constant rates).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
tess.likelihood.ebdstp(
  nodes,
  lambda,
  mu,
  phi,
  r,
  samplingProbabilityAtPresent,
  rateChangeTimesLambda = c(),
  rateChangeTimesMu = c(),
  rateChangeTimesPhi = c(),
  rateChangeTimesR = c(),
  massDeathTimes = c(),
  massDeathProbabilities = c(),
  burstBirthTimes = c(),
  burstBirthProbabilities = c(),
  eventSamplingTimes = c(),
  eventSamplingProbabilities = c(),
  samplingStrategyAtPresent = "uniform",
  MRCA = TRUE,
  CONDITION = "survival",
  log = TRUE
)

Arguments

nodes

node times from tess.branching.times

lambda

birth (speciation or infection) rates

mu

death (extinction or becoming non-infectious without treatment) rates

phi

serial sampling (fossilization) rates

r

treatment probability, Pr(death | sample) (does not apply to samples take at time 0)

samplingProbabilityAtPresent

probability of uniform sampling at present

rateChangeTimesLambda

times at which birth rates change

rateChangeTimesMu

times at which death rates change

rateChangeTimesPhi

times at which serial sampling rates change

rateChangeTimesR

times at which treatment probabilities change

massDeathTimes

time at which mass-deaths (mass-extinctions) happen

massDeathProbabilities

probability of a lineage dying in a mass-death event

burstBirthTimes
burstBirthProbabilities
eventSamplingTimes

time at which every lineage in the tree may be sampled

eventSamplingProbabilities

probability of a lineage being sampled at an event sampling time

samplingStrategyAtPresent

Which strategy was used to obtain the samples (taxa). Options are: uniform|diversified|age

MRCA

does the tree start at the mrca?

CONDITION

do we condition the process on nothing|survival|taxa?

log

likelhood in log-scale?

Value

probability of the speciation times

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(conifers)
  
nodes <- tess.branching.times(conifers)

lambda <- c(0.2, 0.1, 0.3)
mu <- c(0.1, 0.05, 0.25)
phi <- c(0.1, 0.2, 0.05)

changetimes <- c(100, 200)

tess.likelihood.ebdstp(nodes,
                       lambda = lambda, 
                       mu = mu,
                       phi = phi,
                       r = 0.0,
                       rateChangeTimesLambda = changetimes,
                       rateChangeTimesMu = changetimes,
                       rateChangeTimesPhi = changetimes,
                       samplingProbability = 1.0
)

hoehna/TESS documentation built on Feb. 3, 2022, 5:59 a.m.