simABC: Simulate data to be used in ABC

Description Usage Arguments Value

Description

Parameters are drawn from the prior distribution, fed in to the model to produce data, which is processed to produce summary statistics. This process is iterated.

Usage

1
2
simABC(nsims, prior_function, sim_function, sumstat_functions,
  nCores = detectCores())

Arguments

nsims

How many simulations to perform.

prior_function

A function with no arguments returing a vector of parameters drawn from the prior. Ideally this vector should be named.

sim_function

A function taking a vector of parameters as an argument and returning a model data object.

sumstat_functions

A list of functions. Each should take a model data object as argument and return a summary statistic (or a vector, see later), which ideally is named. Sometimes it is convenient to use the same calculations for several summaries. In this case a function can return a vector of summaries. Again these should ideally be named.

nCores

Number of parallel cores to use.

Value

A matrix whose rows are separate simulations. Each row contains the simulations parameters followed by the summaries.


dennisprangle/rainfallABC documentation built on May 15, 2019, 3:26 a.m.