Learn R Programming

abctools (version 0.2-2)

mincrit: Summary statistics selection by minimizing a posterior sample measure.

Description

The function cycles through all possible subsets of summary statistics and computes a criterion from the posterior sample. The subset which achieves the minimum is chosen as the most informative subset.

Usage

mincrit(obs,param, sumstats, obspar=NULL, abcmethod=abc,crit=nn.ent,
sumsubs=1:ncol(sumstats), limit = length(sumsubs), do.only = NULL, 
verbose = TRUE, do.crit = TRUE, do.err=FALSE,final.dens=FALSE,errfn=rsse, ...)

Arguments

Value

A list with the following components:bestthe best subset(s) of statistics.critvalsthe calculated criterion values (if do.crit=TRUE).errsimulation error (if obspar is supplied and do.err=TRUE).orderthe subsets considered during the algorithm (same as the input do.only.post.samplean array of dimension nacc x npar x ndatasets giving the posterior sample for each observed dataset. Not returned if final.dens=FALSE.sumsubsan index into the subsets considered during the algorithm.

Warning

These functions are computationally intensive due to the cyclic ABC inference procedure.

Details

The function uses a criterion (e.g.sample entropy) as a proxy for information in a posterior sample. The criterion for each possible subset of statistics is computed, and the best subset is judged as the one which minimises this vector of values.

References

Nunes, M. A. and Balding, D. J. (2010) On Optimal Selection of Summary Statistics for Approximate Bayesian Computation. Stat. Appl. Gen. Mol. Biol. 9, Iss. 1, Art. 34.

See Also

nn.ent

Examples

Run this code
# load example data:

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])

# example of entropy minimization algorithm:

tmp<-mincrit(obsstats, param, simstats,tol=.01,method="rejection",do.crit=TRUE)

tmp$critvals

Run the code above in your browser using DataLab