Description Usage Arguments Value Note Author(s) References See Also Examples
sim.bd.taxa.age simulates trees on n species with a (i) fixed time since origin or (ii) fixed time since the most recent common ancestor of the sampled species under the constant rate birth-death process. The method allows for incomplete sampling, i.e. each extant tip from a complete tree is included with a fixed probability. The tree is conditioned to have n tips after sampling and a fixed time since origin or since the most recent common ancestor of the sampled species.
1 | sim.bd.taxa.age(n, numbsim, lambda, mu, frac = 1, age, mrca = FALSE)
|
n |
Number of extant sampled tips. |
numbsim |
Number of trees to simulate. |
lambda |
Speciation rate. |
mu |
Extinction rate. |
frac |
Each tip is included into the final tree with probability frac. |
age |
The time since origin / most recent common ancestor. |
mrca |
If mrca = FALSE: The time since the origin of the process. If mrca = TRUE: The time since the most recent common ancestor of the sampled species. |
treearray |
Array of numbsim trees with n>1 tips with a given age. The extinct lineages are not included. |
The algorithm is fast for the critical process, lambda=mu.
Tanja Stadler
T. Stadler: On incomplete sampling under birth-death models and connections to the sampling-based coalescent. J. Theo. Biol. (2009) 261: 58-66.
sim.bd.age, sim.rateshift.taxa, sim.gsa.taxa, birthdeath.tree
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | n<-10
lambda <- 2.0
mu <- 0.5
frac <-0.6
numbsim<-2
age<-2
##
# Simulating numbsim reconstructed trees with n sampled species under a
# birth-death process with speciation rate lambda, extinction rate mu,
# sampling probability frac, and time age since origin:
sim.bd.taxa.age(n, numbsim, lambda, mu, frac, age, mrca = FALSE)
# Simulating numbsim reconstructed trees with n sampled species under a
# birth-death process with speciation rate lambda, extinction rate mu,
# sampling probability frac, and time age since the most recent
# common ancestor of the extant sampled species:
sim.bd.taxa.age(n, numbsim, lambda, mu, frac, age, mrca = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.