
Last chance! 50% off unlimited learning
Sale ends in
stage2(obs, param, sumstats, obspar = NULL, chosen, dsets = 100,
sumsubs = 1:ncol(sumstats), limit = length(sumsubs), do.only = NULL, do.err = FALSE,
final.dens = FALSE, verbose = TRUE, ...)
dsets
simulated datasets closest to the oberved dataset as measured by the chosen
subset of summaries.obspar
is supplied and do.err=TRUE
).do.only
.nacc x npar x ndatasets
giving the posterior sample for each observed dataset. Not returned if final.dens=FALSE
.chosen
set of summaries to determine the dsets
simulated datasets which are closest (in Euclidean norm) to the observed dataset. Since the model parameters generating the summary statistics are known for these simulated datasets, for each candidate subset of summary statistics, we can compute the error under ABC inference for each of these datasets. The best subset of summary statistics is that which minimizes this (average) error over all dsets
datasets.# load example data:
data(coal)
data(coalobs)
param<-coal[,2]
simstats<-coal[,5:8]
# use matrix below just in case to preserve dimensions.
obsstats<-matrix(coalobs[1,5:8],nrow=1)
obsparam<-matrix(coalobs[1,1])
tmp<-stage2(obsstats, param, simstats, chosen=c(1,3), dsets = 10)
tmp$best
Run the code above in your browser using DataLab