Learn R Programming

abctools (version 0.2-2)

semiauto.abc: Performs semi-automatic ABC based on summary statistics regression.

Description

Performs semi-automatic ABC based on summary statistics regression.

Usage

semiauto.abc(obs, param, sumstats, obspar = NULL, abcmethod = abc, saprop = 0.5, 
abcprop = 0.5, overlap = FALSE, satr = list(), plot = FALSE, verbose = TRUE, 
do.err = FALSE, final.dens = FALSE, errfn = rsse, ...)

Arguments

Value

A list with the following components:errsimulation error (if obspar is supplied and do.err=TRUE).post.samplean array of dimension nacc x npar x ndatasets giving the posterior sample for each observed dataset. Not returned if final.dens=FALSE.sainfoA list with the following information about the semi-automatic ABC run: saprop, abcprop ,overlap, satr. See arguments for more details.

Warning

The argument satr must be supplied with valid functions. Whilst there are checks, these are minimal, since doing sophisticated checks is quite difficult.

Details

This function is essentially a wrapper for saABC. See the details section of saABC for more details on the implementation. The argument satr can be almost anything sensible in function form, see Examples section for example specifications.

References

Blum, M. G. B, Nunes, M. A., Prangle, D. and Sisson, S. A. (2013) A comparative review of dimension reduction methods in approximate Bayesian computation. Stat. Sci. (to appear). Fearnhead, P. and Prangle, D. (2012) Constructing summary statistics for approximate Bayesian computation: semi-automatic approximate Bayesian computation. J. R. Stat. Soc. B 74, Part 3, 1--28.

See Also

saABC, selectsumm

Examples

Run this code
data(coal)
data(coalobs)

param<-coal[,2]
simstats<-coal[,4:6]

# use matrix below just in case to preserve dimensions.

obsstats<-matrix(coalobs[1,4:6],nrow=1)
obsparam<-matrix(coalobs[1,1])

# perform semi-automatic ABC with summary statistics defined by X, X^2,X^3,X^4:
# other alternative specifications for this could be:
# list(function(x){ cbind(x,x^2,x^3,x^4) })
# list(as.function(alist(x=,cbind(x,x^2,x^3)))) etc

tmp<-semiauto.abc(obsstats, param, simstats,tol=.01,method="rejection",
satr=list(function(x){outer(x,Y=1:4,"^")}))

tmp$sa.info

# both these functions may be problematic: 

tmp<-semiauto.abc(obsstats, param, simstats,tol=.01,method="rejection",satr=list(unique,sum))

Run the code above in your browser using DataLab