Run FACTS trial simulations.

run_facts(
facts_file,
output_path = tempfile(),
log_path = output_path,
n_burn = NULL,
n_mcmc = NULL,
n_weeks_files = 10000,
n_patients_files = 10000,
n_mcmc_files = 0,
n_mcmc_thin = NULL,
flfll_seed = NULL,
flfll_offset = NULL,
...
)

## Arguments

facts_file Character, name of a FACTS file. Usually has a *.facts file extension. Character, directory path to the files to generate. Character, path to the log file generated by FLFLL. Number of burn-in iterations for the MCMC. Number of MCMC iterations used in inference. Number of weeks*.csv files to save in output_path. Number of patients*.csv files to save in output_path. Number of mcmc*.csv files to save in output_path. Number of thinning iterations for the MCMC. Positive integer, random number generator seed for FLFLL. This seed is only used for stochastic preprocessing steps for generating the *.param files. It is not the random number generator seed for the actual trial simulations. To set the trial simulation seed, use the seed argument of run_facts(), run_engine(), or one of the specific run_engine*() functions. Integer, offset for the random number generator. Named arguments to the appropriate FACTS engine function. Use get_facts_engine() to identify the appropriate engine function and then open the help file of that function to read about the arguments, e.g. ?run_engine_contin.

## Value

Character, path to the directory with FACTS output.

## Details

run_facts() calls run_flfll() and then run_engine(). For finer control over trial simulation, you can call these latter two functions individually.

run_flfll(), run_engine(), get_facts_engine()

## Examples

# Can only run if system dependencies are configured:
if (file.exists(Sys.getenv("RFACTS_PATHS"))) {
facts_file <- get_facts_file_example("contin.facts") # example FACTS file
out <- run_facts(
facts_file,
n_sims = 4,
verbose = FALSE
)
# What results files do we have?
# Read all the "patients*.csv" files with read_patients(out).