abc_smc_cluster: Approximate Bayesian Computation with Sequential Monte Carlo...

Description Usage Arguments Value

View source: R/mpi.R

Description

This function implements the Lenormand algorithm for ABC-SMC designed from the EasyABC R package on arbitrarily user-defined clusters.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
abc_smc_cluster(
  model,
  prior,
  nsims,
  summary_stat_target,
  prior_test = NULL,
  verbose = FALSE,
  dist_weights = NULL,
  cl,
  ...
)

Arguments

model

a R function implementing the model to be simulated. It must take as arguments a vector of model parameter values and it must return a vector of summary statistics.

prior

a list of prior information. Each element of the list corresponds to a model parameter. The list element must be a vector whose first argument determines the type of prior distribution.

nsims

the number of simulations below the tolerance threshold is equal to nsims * alpha.

summary_stat_target

a vector containing the targeted (observed) summary statistics.

prior_test

a string expressing the constraints between model parameters. This expression will be evaluated as a logical expression, you can use all the logical operators including "<", ">", .... Each parameter should be designated with "X1", "X2", ... in the same order as in the prior definition. If not provided, no constraint will be applied.

verbose

If TRUE, ABC_sequential writes in the current directory intermediary results at the end of each step of the algorithm various files.

dist_weights

a vector containing the weights to apply to the distance between the computed and the targeted statistics. These weights can be used to give more importance to a summary statistisc for example. The weights will be normalized before applying them. If not provided, no weights will be applied.

cl

cluster object, such as that produced by snow::makeCluster.

...

Additional arguments can be passed depending on the choosen method (see below).

Value

The returned value is a list containing the following components:

param

The model parameters used in the model simulations.

stats

The summary statistics obtained at the end of the model simulations.

weights

The weights of the different model simulations.

stats_normalization

The standard deviation of the summary statistics across the model simulations of the initial step. These values are used to normalize the summary statistics before the computation of the Euclidean distance between simulations and data.

epsilon

The final maximal distance between simulations and data in the retained sample of particles.

nsim

The number of model simulations performed.

computime

The computing time to perform the simulations.

intermediary

Intermediary results stored when the option "verbose=TRUE" is chosen. Each element of this list corresponds to a different step. See the argument verbose above for more details on the information stored.


EpiModel/EasyABCMPI documentation built on Dec. 5, 2020, 8:43 p.m.