semiauto.abc | R Documentation |
Performs semi-automatic ABC based on summary statistics regression.
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, ...)
obs |
(matrix of) observed summary statistics. |
param |
matrix of simulated model parameter values. |
sumstats |
matrix of simulated summary statistics. |
obspar |
optional observed parameters (for use to assess simulation performance). |
abcmethod |
a function to perform ABC inference, e.g. the |
saprop |
a proportion, denoting the proportion of simulated datasets with which to perform semi-automatic ABC regression. |
abcprop |
a proportion, denoting the proportion of simulated datasets with which to perform ABC using |
overlap |
a boolean value indicating whether the simulated datasets specified by |
satr |
a list of functions indicating transformations of the summary statistics |
plot |
When plot==TRUE, a plot of parameter values against fitted values is produced for each parameter as a side-effect. This is most useful when the number of parameters is reasonably small. |
verbose |
a boolean value indicating whether informative statements should be printed to screen. |
do.err |
a boolean value indicating whether the simulation error should be returned. Note: if |
final.dens |
a boolean value indicating whether the posterior sample should be returned. |
errfn |
an error function to assess ABC inference performance. |
... |
any other optional arguments to the ABC inference procedure (e.g. arguments to the |
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.
A list with the following components:
err |
simulation error (if |
post.sample |
an array of dimension |
sainfo |
A list with the following information about the semi-automatic ABC run: |
The argument satr
must be supplied with valid functions. Whilst there are checks, these are minimal, since doing sophisticated checks is quite difficult.
Matt Nunes and Dennis Prangle
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. 28, Issue 2, 189–208.
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.
Nunes, M. A. and Prangle, D. (2016) abctools: an R package for tuning
approximate Bayesian computation analyses. The R Journal
7, Issue 2, 189–205.
saABC
, selectsumm
## Not run:
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))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.