Learn R Programming

abcrf (version 1.2)

abcrf: Create an ABC-RF object: a classification random forest from a reference table towards performing an ABC model choice

Description

abcrf constructs a random forest from a reference table towards performing an ABC model choice. Basically, the reference table (i.e. the dataset that will be treated with the present package) includes a column with the index of the models to be compared and additional columns corresponding to the values of the simulated summary statistics.

Usage

## S3 method for class 'factor':
abcrf(modindex, sumsta, lda=TRUE, ntree=500, 
sampsize=min(1e5, length(modindex)), paral=FALSE, ...) 
## S3 method for class 'formula':
abcrf(formula, data=NULL, ...)

Arguments

modindex
a factor containing the model indices of the reference table.
sumsta
a matrix or a data frame containing the summary statistics of the reference table.
lda
should LDA scores be added to the list of summary statistics?
ntree
number of trees to grow in the forest, by default 500 trees.
sampsize
size of the sample from the reference table to grow a tree of the classification 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 classification random forest (forest used to assign a model to the observed dataset) should be parallelized. If yes, it is used the number of CPU cores minus 1.
formula
a formula: left of ~, variable representing the model index; right of ~, summary statistics.
data
an optional data frame containing the reference table.
...
additional arguments to be passed on to randomForest used to construct the classification random forest that preditcs the selected model.

Value

  • An object of class abcrf, which is a list with the following components:
  • callthe original call to abcrf,
  • ldaa boolean indicating if LDA scores have been added to the list of summary statistics,
  • model.rfan object of class randomForest containing the trained forest with the reference table,
  • model.ldaan object of class lda containing the Linear Discriminant Analysis based on the reference table,
  • prior.errprior error rates of model selection on the reference table, estimated with the "out-of-bag" error of the forest,
  • sumstathe reference table including the LDA scores if lda=TRUE.

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

plot.abcrf, predict.abcrf, err.abcrf, randomForest

Examples

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

Run the code above in your browser using DataLab