Learn R Programming

abcrf (version 1.2)

predict.abcrf: Predict and evaluate the posterior probability of the MAP for new data using an ABC-RF object

Description

Using an ABC-RF object this function predict the model for new data and evaluate the posterior probability of the MAP.

Usage

## S3 method for class 'abcrf':
predict(object, obs, ntree=1000, sampsize=min(1e5, dim(sumsta)[1]), paral=FALSE, ...)

Arguments

object
an abcrf object.
obs
a data frame or a matrix containing the summary statistics of the observed data sets.
ntree
number of trees to grow in the regression forest, by default 1,000 trees.
sampsize
size of the sample from the reference table to grow a tree of the forest, by default the minimum between the number of elements of the reference table and 100,000.
paral
a boolean that indicates if the calculations of the regression random forest (forest that returns the posterior probability of the selected model) should be parallelized. If yes, the number of CPU cores minus 1 is used.
...
additional arguments to be passed on to randomForest used to construct the regression random forest that estimates the posterior probability of the selected model.

Value

  • An object of class abcrfpredict, which is a list with the following components:
  • allocationindexes of the selected model for each observed data set,
  • votevotes for each observed dataset,
  • post.probABC-RF approximations of the posterior probability of the selected model for each observed dataset.

References

Pudlo, P., Marin, J.-M., Estoup, A., Cornuet, J.-M., Gautier, M. & Robert, C. P. (2015). Reliable ABC model choice via random forests. Bioinformatics. http://bioinformatics.oxfordjournals.org/content/early/2015/12/23/bioinformatics.btv684

See Also

abcrf, plot.abcrf, err.abcrf,

Examples

Run this code
data(snp)
modindex <- snp[1:500, 1]
sumsta <- snp[1:500, -1]
model.rf <- abcrf(modindex, sumsta, ntree=100)
data(snp.obs)
predict(model.rf, snp.obs, ntree=100)

Run the code above in your browser using DataLab