Learn R Programming

EasyABC (version 1.0)

ABC_sequential: Sequential sampling schemes for ABC

Description

This function implements four different algorithms to perform sequential sampling schemes for ABC. Sequential sampling schemes consist in sampling initially model parameters in the prior distribution, just like in a standard rejection-based ABC, in order to obtain a rough posterior distribution of parameter values, and in subsequently sampling close to this rough posterior distribution to refine it. Sequential sampling schemes have been shown to be more efficient than standard rejection-based procedures.

Usage

ABC_sequential(method, model, prior_matrix, nb_simul, summary_stat_target, n_cluster = 1,...)

Arguments

method
a character string indicating the sequential algorithm to be used. Possible values are "Beaumont", "Drovandi", "Delmoral" and "Lenormand".
model
a R function implementing the model to be simulated. It must take as arguments an array containing a seed value (if use_seed=TRUE) and the model parameters and returning an array of summary statistics obtained at the end of the s
prior_matrix
a matrix or data frame containing the ranges of the prior distribution for each of the $p$ model parameters. It has $p$ lines and 2 columns. The first (second) column contains the lower (upper) bound of the prior distribution of the $p$ parameters.
nb_simul
a positive integer equal to the desired number of simulations of the model below the tolerance threshold when method is "Beaumont", "Drovandi" and "Delmoral". When method is "Lenorma
summary_stat_target
a vector containing the targeted (observed) summary statistics.
n_cluster
a positive integer. If larger than 1 (the default value), ABC_sequential will launch model simulations in parallel on n_cluster cores of the computer.
...
Additional arguments can be passed depending on the choosen method (see below)

Value

  • The returned value is a list containing the following components:
  • paramThe model parameters used in the model simulations.
  • statsThe summary statistics obtained at the end of the model simulations.
  • weightsThe weights of the different model simulations.
  • stats_normalizationThe 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.
  • epsilonThe final maximal distance between simulations and data in the retained sample of particles.
  • nsimThe number of model simulations performed.
  • computimeThe computing time to perform the simulations.

Details

See the package's vignette for details on the four algorithms.

References

Beaumont, M. A., Cornuet, J., Marin, J., and Robert, C. P. (2009) Adaptive approximate Bayesian computation. Biometrika,96, 983--990. Del Moral, P., Doucet, A., and Jasra, A. (2012) An adaptive sequential Monte Carlo method for approximate Bayesian computation. Statistics and Computing, 22, 1009--1020. Drovandi, C. C. and Pettitt, A. N. (2011) Estimation of parameters for macroparasite population evolution using approximate Bayesian computation. Biometrics, 67, 225--233. Lenormand, M., Jabot, F., Deffuant G. (2012) Adaptive approximate Bayesian computation for complex models. http://arxiv.org/pdf/1111.1308.pdf

See Also

binary_model, binary_model_cluster, ABC_rejection, ABC_mcmc

Examples

Run this code
priormatrix=cbind(c(500,3,-2.3,1,-25,-0.7),c(500,5,1.6,1,125,3.2))
    sum_stat_obs=c(100,2.5,20,30000)

    ## artificial example to perform the Beaumont et al. (2009)'s method.
    ##
    ABC_Beaumont<-ABC_sequential(method="Beaumont", model=trait_model, prior_matrix=priormatrix,
    nb_simul=10, summary_stat_target=sum_stat_obs, n_cluster=1, tolerance_tab=c(8,5))
    ABC_Beaumont

    ## artificial example to perform the Drovandi and Pettitt (2011)'s method.
    ##
    ABC_Drovandi<-ABC_sequential(method="Drovandi", model=trait_model, prior_matrix=priormatrix,
    nb_simul=10, summary_stat_target=sum_stat_obs, n_cluster=1, tolerance_tab=3, c=0.7)
    ABC_Drovandi

    ## artificial example to perform the Del Moral et al. (2012)'s method.
    ##
    ABC_Delmoral<-ABC_sequential(method="Delmoral", model=trait_model, prior_matrix=priormatrix,
    nb_simul=10, summary_stat_target=sum_stat_obs, n_cluster=1, alpha=0.5, tolerance_target=3)
    ABC_Delmoral

    ## artificial example to perform the Lenormand et al. (2012)'s method.
    ##
    ABC_Lenormand<-ABC_sequential(method="Lenormand", model=trait_model, prior_matrix=priormatrix,
    nb_simul=10, summary_stat_target=sum_stat_obs, n_cluster=1, p_acc_min=0.4)
    ABC_Lenormand

Run the code above in your browser using DataLab