Learn R Programming

paleotree (version 1.8.2)

simPaleoTrees: Simulating Un-Conditioned Trees of Fossil Taxa

Description

Creates sets of paleo-trees with minimal conditioning and with sampling such that lineages may be missing and terminal branches are truncated, but node-times are known perfectly

Usage

simPaleoTrees(p, q, r, ntrees = 1, all.extinct = FALSE, modern.samp.prob = 1.0, 
    mintime = 1, maxtime = 100, mintaxa = 2, maxtaxa = 500, anag.rate = 0, 
    prop.bifurc = 0, prop.cryptic = 0, drop.zlb = TRUE, print.runs = FALSE,
    plot = FALSE)

Arguments

p
Instantaneous rate of speciation per lineage-time units
q
Instantaneous rate of extinction per lineage-time units
r
Instantaneous rate of sampling per lineage-time units
ntrees
Number of trees to simulate
all.extinct
Condition on all taxa being extinct by modern? Default is false
modern.samp.prob
Probability of sampling living taxa at the present day (time=0), see documentation for sampleRanges
mintime
Minimum time to run simulation
maxtime
Maximum time to run simulation
mintaxa
Minimum number of taxa allowed over entire simulation
maxtaxa
Maximum number of taxa allowed over entire simulation
anag.rate
Instantaneous rate of pseudoextinction/anagensis.
prop.bifurc
Proportion of morphological branching by bifurcating cladogenesis relative to budding cladogenesis.
prop.cryptic
Proportion of cryptic speciation by relative to morphological branching, such as bifurcating and budding. Trees with cryptic taxa are always returned with cryptic taxa unmerged (see sampleRanges).
drop.zlb
Should zero-length branches be dropped?
print.runs
Print the proportion of simulations accepted for output?
plot
Should data be plotted as it is simulated?

Value

  • Output is an object of class multiphylo containing the simulated phylogenies, unless ntrees is one in which case the output is a phylogeny of class 'phylo'. Additionally, each of these simulated phylogenies will have the original simulated taxa data (from simFossilTaxa) and sampled ranges (from sampleRanges) attached as the elements $taxa and $ranges to each phylo object.

Details

Essentially a complex wrapper for simFossilTaxa, sampleRanges and taxa2phylo, this function will spit out simulated phylogenies of fossil taxa where the divergence times are perfectly known, only sampled taxa are included on the tree and tips are located at the last observed time for the species (the apparent time of extinction, except for living taxa). simPaleoTrees essentially uses simFossilTaxa with no.cond as TRUE and other minimal conditioning, so as to get as unbiased a sample of simulations as possible (without exceeding the maximum constraints). This is useful for birth-death analyses, although a number of options available in simFossilTaxa are thus unavailable in simPaleoTrees. By default, there is no conditioning on the number of extant taxa, living taxa are sampled perfectly at time 0 and zero-length branches are dropped. Unlike simFossilTaxa, you cannot condition on a certain number of extant taxa, only whether they are allowed or not (via all.extinct). As of version 1.6, there are now options relating to speciation modes. By default, taxa are only simulated under budding cladogenesis but this can be changed with the arguments anag.rate, prop.bifurc and prop.cryptic. Trees with cryptic taxa are always returned with cryptic taxa unmerged (see sampleRanges). Because the divergence times are known perfectly, yet tips are at the apparent time of extinction and unsampled taxa are dropped, one should not use the output of this analysis except for very specialized simulation analyses. The results are probably not anything like real datasets of paleontological phylogenies, at least in most aspects. The print.runs argument does not work precisely as in simFossilTaxa; it only counts how many accepted datasets from simFossilTaxa are acceptable for output after the simulation of sampling.

See Also

simFossilTaxa, taxa2phylo, sampleRanges

Examples

Run this code
set.seed(444)
#simulate trees conditioned to have no living descendants
trees <- simPaleoTrees(p=0.1,q=0.1,r=0.5,ntrees=10,all.extinct=TRUE,maxtime=100,
    print.runs=TRUE,plot=TRUE)
#number of tips
sapply(trees,Ntip)

#simulate trees conditioned to have possible living taxa and perfect sampling at modern
trees <- simPaleoTrees(p=0.1,q=0.1,r=0.5,ntrees=10,all.extinct=FALSE,maxtime=100,
    modern.samp.prob=TRUE,print.runs=TRUE,plot=TRUE)
#number of tips
sapply(trees,Ntip)

Run the code above in your browser using DataLab