Description Usage Arguments Details Value Examples
View source: R/samplingControl.R
Create a SamplingControl object, which determines which ABC algorithm is to be used, and how it is configured.
1 | SamplingControl(seed, n_cores, algorithm = "Beaumont2009", params = NA)
|
seed |
an integer, giving the seed to be used when simulating epidemics |
n_cores |
an integer giving the number of CPU cores to employ |
algorithm |
a string, either equal to "BasicABC" for the simple ABC rejection algorithm of Rubin (1980), "Beaumont2009" for the SMC approach of Beaumont et al. (2009), or "DelMoral2006" for the adaptive SMC approach of Del Moral (2012). |
params |
optional algorithm configuration parameters, see: detail. |
The basic ABC algorithm is useful in cases where good prior information is available, and proposals from the prior distribution are therefore likely to fall with relative frequency into high posterior density regions. In cases where the prior is diffuse with respect to the posterior, this can be very inefficient. The SMC algorithms of Del Moral 2012 and Beaumont et al. 2009 randomly generate parameters from a sequence of approximations to the posterior distribution, and can greatly improve efficiency.\
Additional parameters which may be passed to the algorithms:
acceptance_fraction: For the BasicABC algorithm, this gives the proportion of simulated epidemics to accept. The smaller the acceptance fraction, the better the approximation to the posterior distribution, and the more computation time required.
target_eps:For all algorithms, this determines an epsilon value at which the program will terminate, declaring convergence.
batch_size: For all algorithms, this determines the number of
epidemics to simulate in parallel, before returning to the main process to evaluate
them. batch_size
must be greater than the number of samples requested
in the SpatialSEIRModel
function.
init_batch_size: For all algorithms, this optionally determines a distinct batch size for the first iteration.
epochs: For the Beaumont2009 and DelMoral2012 algorithms,
epochs
determines the maximum
number of iterations.
shrinkage: for the Beaumont2009 algorithm, shrinkage
defines the multiplicative
constant by which the maximum distance between simulated and observed
epidemics is shrunk between each iteration. For the DelMoral2012 algorithm, this
parameter determines the quality index, alpha between zero and one.
lpow: Integer exponent for comparison of simulated and observed epidemics (L1, L2, etc)
max_batches: for the Beaumont2009 and DelMoral2012 algorithms, max_batches
determines
the maximum number of parallel batches to run before which a new set of
parameters must be accepted. If an insufficient number of parameters are accepted
by the time the algorithm reaches max_batches
, the program will terminate
under the assumption that the parameters have converged.
multivariate_perturbationA logical value indicating whether, for the Beaumont2009 algorithm, parameter perturbations should be made from a mulivariate normal distribuion rather than independent normals.
mFor the DelMoral2012 algorithm, an integer determining the number of simulated epidemics to use for each set of basis parameters (parameterized as in the 2012 paper.)
particlesFor the 'simulate' algorithm, a raw matrix of parameter
values must be provided, following the format created by the other
algorithms. This functonality is used primarily for debugging purposes; most
users should perform such simulations using the epidemic.simulations
function instead.
keep_compartmentsLogical: should the simulated compartment values be retained?
replicatesFor the 'simulate' algorithm, a number of replicate simulations to be performed per particle.
an object of type SamplingControl
1 | samplingControl <- SamplingControl(123123, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.