# 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 a leave-one-out cross validation of model selection
sim_modelSel(index = index, sumstats = sumstats, nval = 10, tol = 0.1)
Run the code above in your browser using DataLab