dnCDBDP - Character-dependent birth-death process
| rootAge/originAge : | RealPos (pass by const reference) |
| The start time of the process. | |
| speciationRates/lambda/cladoEventMap : | CladogeneticSpeciationRateMatrix (pass by const reference) |
| The vector of speciation rates (for anagenetic-only models), or the map of speciation rates to cladogenetic event types. | |
| extinctionRates/mu : | RealPos[] (pass by const reference) |
| The vector of extinction rates. | |
| psi/phi : | RealPos[] (pass by const reference) |
| The vector of serial sampling rates. | |
| Default : NULL | |
| Q : | RateGenerator (pass by const reference) |
| The rate matrix of jumping between rate categories. | |
| Default : NULL | |
| delta : | RealPos (pass by const reference) |
| The rate-factor of jumping between rate categories. | |
| Default : 1 | |
| pi : | Simplex (pass by const reference) |
| State frequencies at the root. | |
| Default : NULL | |
| rho : | Probability (pass by const reference) |
| The taxon sampling probability. | |
| Default : 1 | |
| condition : | String (pass by value) |
| The condition of the birth-death process. | |
| Default : time | |
| Options : time|survival | |
| nTimeSlices : | RealPos (pass by value) |
| The number of time slices for the numeric ODE. | |
| Default : 500 | |
| simulateCondition : | String (pass by value) |
| The conditions under which to simulate. | |
| Default : startTime | |
| Options : startTime|numTips|tipStates|tree | |
| minNumLineages : | Natural (pass by value) |
| The minimum number of lineages to simulate; applied under the startTime condition. | |
| Default : 0 | |
| maxNumLineages : | Natural (pass by value) |
| The maximum number of lineages to simulate; applied under the startTime condition. | |
| Default : 500 | |
| exactNumLineages : | Natural (pass by value) |
| The exact number of lineages to simulate; applied under the numTips condition. | |
| Default : 100 | |
| maxTime : | RealPos (pass by value) |
| Maximum time for lineages to coalesce when simulating; applied under the numTips and tipStates condition. | |
| Default : 1000 | |
| pruneExtinctLineages : | Bool (pass by value) |
| When simulating should extinct lineages be pruned off? | |
| Default : TRUE | |
| allowRateShiftsAtExtinctLineages : | Bool (pass by value) |
| Should we allow rate shifts to occur on extinct lineages? | |
| Default : TRUE |
# setup for a two-state ClaSSE model
num_states = 2 # 0 and 1 are the only states
# set basic process parameters
root_age ~ dnUniform(0, 2)
rho <- Probability(1/2) # sampling one half of extant lineages
# specify extinction probabilities for each state
mu_vec <- rep(0.1, 2)
# Set up cladogenetic events and speciation rates. Each element
# in clado_events describes a state pattern at the cladogenetic
# event: for example, [0, 0, 1] denotes a parent having state 0
# and its two children having states 0 and 1.
clado_events = [[0, 0, 1], [0, 1, 0], [1, 0, 1], [1, 1, 0]]
# set speciation rates for each cladogenetic event described above
lambda ~ dnExponential( 10.0 )
speciation_rates := rep(lambda, 4)
# create cladogenetic rate matrix
clado_matrix = fnCladogeneticSpeciationRateMatrix(clado_events,
speciation_rates,
num_states)
# set up Q-matrix to specify rates of state changes along branches
ana_rate_matrix <- fnFreeK( [[0, .2], [.2, 0]], rescaled=FALSE )
# create vector of state frequencies at the root
pi <- simplex([1, 2])
# basic use of the function
timetree ~ dnCDBDP(rootAge = root_age,
lambda = clado_matrix,
mu = mu_vec,
Q = ana_rate_matrix,
pi = pi,
rho = rho,
condition = "time")