When used for demographic inference, Jaatha supports using the package
coala as simulation engine. If these packages do not suit your needs, it is of course also possible to use the normal interface described in the
Jaatha automatically creates a simulation function, parameter ranges and summary statistics from a
coala model. We can for example specify a simple isolation-with-migration model using
par_ranges to mark parameters we want to estimate with Jaatha:
We can now just pass this
coala model to the
create_jaatha_model function to convert it into a Jaatha model:
## A simulation takes less than a second
coala for the simulations, gets the parameter ranges specified with
par_range and uses summary statistics added to the model. Coala supports a wide range of models. Please refer to its documentation for more information.
You can use coala’s
calc_sumstats_form_data function to calculate the summary statistic for genetic data. The output of this function can be directly passed on to
From here on, you can estimate parameters using the
jaatha as described in the introduction vignette.
If you are using a simulator that is writing temporary files to disk (e.g.
seq-gen), please make sure that there is sufficient free space on your
tempdir() to store the output of
sim simulations per core that you use (arguments
cores in the
jaatha function). Also, please make sure that your machine does not run out of memory. Both will lead to failtures during the estimation process. Reducing the number of cores reduces both the required memory and disk space at the cost of a longer runtime.