Last chance! 50% off unlimited learning
Sale ends in
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, ...)
A list with the following components:
simulation error (if obspar
is supplied and do.err=TRUE
).
an array of dimension nacc x npar x ndatasets
giving the posterior sample for each observed dataset. Not returned if final.dens=FALSE
.
A list with the following information about the semi-automatic ABC run:
saprop
, abcprop
,overlap
, satr
. See arguments for more details.
(matrix of) observed summary statistics.
matrix of simulated model parameter values.
matrix of simulated summary statistics.
optional observed parameters (for use to assess simulation performance).
a function to perform ABC inference, e.g. the abc
function from package abc.
a proportion, denoting the proportion of simulated datasets with which to perform semi-automatic ABC regression.
a proportion, denoting the proportion of simulated datasets with which to perform ABC using abcmethod
.
a boolean value indicating whether the simulated datasets specified by saprop
and abcprop
are disjoint (overlap=FALSE
) or not.
a list of functions indicating transformations of the summary statistics sumstats
. These must be *suitable* functions, and must each return a vector, matrix or array with the number of elements being a multiple of the rows of sumstats
. See details and examples sections for more information
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.
a boolean value indicating whether informative statements should be printed to screen.
a boolean value indicating whether the simulation error should be returned. Note: if do.err=TRUE
, obspar
must be supplied.
a boolean value indicating whether the posterior sample should be returned.
an error function to assess ABC inference performance.
any other optional arguments to the ABC inference procedure (e.g. arguments to the abc
function).
Matt Nunes and Dennis Prangle
The argument satr
must be supplied with valid functions. Whilst there are checks, these are minimal, since doing sophisticated checks is quite difficult.
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.
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
if (FALSE) {
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