Learn R Programming

coala (version 0.2.0)

simulate.coalmodel: Simulates data according to a demographic model

Description

Simulates data according to a demographic model

Usage

## S3 method for class 'coalmodel':
simulate(object, nsim = 1, seed, ..., pars = numeric(0),
  cores = 1)

Arguments

object
The coalescent model to be simulated
nsim
currently unused
seed
A random seed that is set before simulation.
...
currently unused
pars
Values for parameters specified with par_named or par_range. Should be a named numeric vector.
cores
The number of cores that the independent repetitions from nsim will be distributed on. Must be 1 on Windows, and should also be 1 when using R in a graphical environment (e.g. Rstudio).

Value

  • A list of summary statistics.

Examples

Run this code
model <- coal_model(c(5,10), 20) +
  feat_pop_merge(par_range('tau', 0.01, 5), 2, 1) +
  feat_mutation(par_range('theta', 1, 10)) +
  sumstat_jsfs()

simulate(model, pars=c(1, 5))

Run the code above in your browser using DataLab