Title: | Evolution Emulator: Species Diversification under an Evolutionary Relatedness Dependent Scenario |
---|---|
Description: | Evolutionary relatedness dependent diversification simulation powered by the 'Rcpp' back-end 'SimTable'. |
Authors: | Tianjian Qin [aut, cre],
Hanno Hildenbrandt [aut] |
Maintainer: | Tianjian Qin <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2025-03-14 22:27:38 UTC |
Source: | https://github.com/evolandeco/evesim |
The edd_sim
function simulates evolutionary relatedness dependent phylogenies based on the specified parameters, given a fixed crown age.
It provides functionality to retry the simulation multiple times in case of errors, with an optional limit on the size of the result.
edd_sim( pars, age, metric = "ed", offset = "none", size_limit = 10000, retry = 100 )
edd_sim( pars, age, metric = "ed", offset = "none", size_limit = 10000, retry = 100 )
pars |
A numeric vector of 6 parameters for the simulation:
|
age |
A numeric value representing the maximum crown age at which the simulation will stop. |
metric |
A character string indicating the evolutionary relatedness measure to be used in the simulation. Options are:
|
offset |
A character string specifying the method for applying an offset. Currently, only |
size_limit |
An integer specifying the maximum size of the simulation result. Defaults to |
retry |
An integer specifying the number of retry attempts in case of failure. Defaults to |
The function simulates evolutionary relatedness dependent diversification based on a specified set of parameters (pars
). The intrinsic
speciation rate (lambda_0
) must be positive and greater than the intrinsic extinction rate (mu_0
). The
remaining parameters, which account for the effects of species richness and evolutionary relatedness on diversification
rates, can be of any sign or zero. The simulation may be retried multiple times (up to the specified retry
limit)
if failures occur during execution.
The metric
argument allows for different ways of measuring evolutionary relatedness, with three options: phylogenetic
diversity ("pd"
), evolutionary distinctiveness ("ed"
), and nearest neighbor distance ("nnd"
). When using
the phylogenetic diversity metric, an optional offset method ("simtime"
) is available. The simulation will terminate
once the specified age
is reached or the size_limit
is exceeded.
A list containing the following components:
A phylogeny with only extant lineages, or NULL
if the simulation failed after all retry attempts.
A phylogeny with all lineages, or NULL
if the simulation failed after all retry attempts.
An L table recording the historical events, or NULL
if the simulation failed after all retry attempts.
A character string containing error messages (if any) accumulated over the retry attempts.
Impact of Evolutionary Relatedness on Species Diversification: A New Birth-Death Model Tianjian Qin, Luis Valente, Rampal S. Etienne Journal of Theoretical Biology; DOI: https://doi.org/10.1016/j.jtbi.2024.111992
# Example of simulation and plotting # optionally set the number of threads. # defaults to number of logical cores. # RcppParallel::setThreadOptions(numThreads = 1) pars = c(0.5, 0.1, -0.001, -0.001, 0.0, 0.0) sim <- edd_sim(pars = pars, age = 10, metric = "nnd", offset = "none")
# Example of simulation and plotting # optionally set the number of threads. # defaults to number of logical cores. # RcppParallel::setThreadOptions(numThreads = 1) pars = c(0.5, 0.1, -0.001, -0.001, 0.0, 0.0) sim <- edd_sim(pars = pars, age = 10, metric = "nnd", offset = "none")