The function draws parameter values from the posterior distribution and then internally runs the function simulate_grid to run simulations from the sampled parameters and compute tree-sequence summary statistics

# S3 method for demografr_abc.abc
predict(
  object,
  samples,
  stat = NULL,
  posterior = c("adj", "unadj"),
  strict = FALSE,
  functions = NULL,
  ...
)

Arguments

object

ABC object generated by run_abc

samples

Number of draws from the posterior distribution to simulate

stat

Which tree-sequence summary statistic to compute? If NULL, all summary statistics will be computed.

posterior

Should 'unadj'usted or 'adj'usted parameters be sampled? Default (recommended) value is 'unadj'usted.

strict

Should parameter combinations leading to invalid slendr models be treated as an error? Default is TRUE. If set to FALSE, invalid simulations will be simply dropped, with an informative message. This parameter is internally passed to the function simulate_grid() which performs the simulations across a sampled parameter matrix.

functions

A named list of summary statistic tree-sequence functions to be applied to each simulated tree sequence. If NULL (the default), the same summary statistics will be computed as those that were used in the ABC inference itself. Otherwise, custom tree-sequence summary statistics can be provided.

...

A formal argument of the predict generic method (unused)

Value

A data frame object with the results of posterior simulations, with values of each summary statistic stored in a list-column (i.e. the same format as used by the function simulate_grid, as the predictions are generated internally using this function)