.chain_sim | R Documentation |
Code modified from the bpmodels::chain_sim()
function.
The function chain_sim()
function from bpmodels is reused with
permission and licensed under MIT as is bpmodels.
bpmodels is not on CRAN and is retired.
.chain_sim(
n,
offspring,
stat = c("size", "length"),
stat_threshold = Inf,
generation_time,
tf = Inf,
...
)
n |
Number of simulations to run. |
offspring |
Offspring distribution: a character string corresponding to
the R distribution function (e.g., "pois" for Poisson, where
|
stat |
String; Statistic to calculate. Can be one of:
|
stat_threshold |
A size or length above which the simulation results
should be set to |
generation_time |
The generation time generator function; the name of a
user-defined named or anonymous function with only one argument |
tf |
End time (if |
... |
Parameters of the offspring distribution as required by R. |
A <data.frame>
with columns n
(simulation ID), id
(a unique
ID within each simulation for each individual element of the chain),
ancestor
(the ID of the ancestor of each element), and generation
. A
time
column is also appended if the generation_time interval is supplied to
serial
.
Sebastian Funk, James M. Azam, Joshua W. Lambert
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.