Simulate data from the null and alternative distributions to estimate ROC curves for a collection of methods.

simulate_roc(
  apply_methods,
  gen_null_data,
  gen_alt_data,
  nruns = 100,
  core_count = parallel::detectCores() - 1,
  seed = NULL
)

Arguments

apply_methods

a function that returns a data.frame with columns "method", "tstat" and "twosided"

gen_null_data

a function that generate data under the null model

gen_alt_data

a function that generate data under the alternative model

nruns

number of simulated data from the null/alternative model

core_count

number of cores used in parallel computing

seed

seed for random simulation

Value

a list of result

roc

A data frame used to plot ROC curves with columns: method, whether a two sided test, false positive rate (FPR), and true positive rate (TPR)

raw

A data frame containing raw output from null and alternative models with columns: method, statistics value, whether a two sided test, and the type of hypothesis

elapsed_time

symstem elapsed time for generating ROC data