sim.fbd.rateshift.taxa {FossilSim} | R Documentation |
sim.fbd.rateshift.taxa: Simulating fossilized birth death trees incorporating rate shifts.
Description
sim.fbd.rateshift.taxa: Simulating fossilized birth death trees incorporating rate shifts.
Usage
sim.fbd.rateshift.taxa(n, numbsim, lambda, mu, psi, times, complete = FALSE)
Arguments
n |
Number of extant sampled tips. |
numbsim |
Number of trees to simulate. |
lambda |
Vector of speciation rates, the rate in entry i is the speciation rate prior (ancestral) to time times[i]. |
mu |
Vector of extinction rates, the rate in entry i is the extinction rate prior (ancestral) to time times[i]. |
psi |
Vector of fossil sampling rates, the rate in entry i is the fossil sampling rate prior (ancestral) to time times[i]. |
times |
Vector of mass extinction and rate shift times. Time is 0 today and increasing going backwards in time. Specify the vector as times[i]<times[i+1]. times[1]=0 (today). |
complete |
whether to return the complete tree (with non-sampled lineages) or the reconstructed tree (with unsampled lineages removed). |
Value
List of numbsim simulated SAtrees with n extant sampled tips.
Examples
n = 10
numbsim = 1
if (requireNamespace("TreeSim", quietly = TRUE)) {
sim.fbd.rateshift.taxa(n, numbsim, lambda = c(2,1), mu = c(0,0.3), psi = c(1,0.1), times = c(0,0.3))
}