View source: R/functions_ABC.R
summary_modelSelect | R Documentation |
Extract the posterior model probabilities and obtain a summary of model selection performed with Approximate Bayesian Computation.
summary_modelSelect(object, print = TRUE)
object |
a list created by the |
print |
logical, if TRUE (default), then this function prints the mean models probabilities. |
This function produces an easy-to-read output of the model selection step. It also computes the Bayes factors.
a list with two main elements if model selection used the regression algorithm or a single element if only the rejection step was used:
rejection |
results of model selection based on the rejection method. This element contains two entries, the first is an object of class numeric with the posterior model probabilities and the second are the Bayes factors between pairs of models. |
mnlogistic |
results of model selection based on the regression method. This element contains two entries, the first is an object of class numeric with the posterior model probabilities and the second are the Bayes factors between pairs of models. |
# load the matrix with simulated parameter values
data(sumstats)
# select a random simulation to act as target just to test the function
target <- sumstats[10 ,]
# create a "fake" vector of model indices
# this assumes that half the simulations were from one model and the other half from other model
# this is not true but serves as an example of how to use this function
index <- c(rep("model1", nrow(sumstats)/2), rep("model2", nrow(sumstats)/2))
# perform model selection with ABC
mysel <- modelSelect(target = target, index = index, sumstats = sumstats,
tol = 0.01, method = "regression")
# compute posterior model probabilities
summary_modelSelect(object = mysel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.