knitr::opts_chunk$set(
  collapse = TRUE,
  cache = TRUE,
  comment = "#>"
)

The conceptual structure of a numerical simulation

The goal of a numerical simulation is to evaluate the performance of one or more statistical methods on data generated from one or more data-generating distributions.

knitr::include_graphics("../man/figures/simulatr-schematic.png")

simulatr specifier objects

In simulatr, the aforementioned components are all captured by a simulatr specifier object. This object has five fields, which are described below:

simulatr workflow

  1. Assemble simulation components. First, assemble the five objects described in the previous section.

  2. Create a simulatr specifier object. Given the four simulation components, create a simulatr specifier object using the simulatr_specifier() function: r simulatr_spec <- simulatr_specifier( parameter_grid, fixed_parameters, generate_data_function, run_method_functions, evaluation_functions )

  3. Check and, if necessary, update the simulatr specifier object. Make sure that all parts of your simulatr specifier object are working by running a small portion of your simulation via the check_simulatr_specifier_object() function. This function takes as arguments the simulatr specifier object (simulatr_spec) as well as the number of data realizations to try (B_in). For checking purposes, you can use a small number for B_in like 2 or 3. r check_results <- check_simulatr_specifier_object(simulatr_spec, B_in = 3) If there are any errors, simulatr will give informative error messages that will let you know which method and which parameter setting caused the problem, along with the corresponding data realization. Update the simulatr specifier object to fix any issues.

  4. Run the simulation. There are two options for running a numerical simulation with simulatr. You can run simulatr either (1) on your laptop, if your simulation is small or (2) on a distributed computing platform, if your simulation is large.

  5. Summarize and / or visualize the results. The simulatr output will give you the value of each evaluation metric on each method on each problem setting. You can then create tables or graphs of these results.



timothy-barry/simulatr documentation built on Sept. 6, 2024, 7:10 p.m.