Run a method-testing bundle (simulate + audit + standard outputs)
Source:R/spesim_method_test.R
spesim_method_test.RdConvenience helper for teaching and method testing.
spesim_method_test() runs a simulation, computes a lightweight audit of the
realised regime (via spesim_audit()), and optionally returns a small set of
standard analysis tables and plots.
Compared to spesim_demo(), this helper is oriented toward auditing and
comparing settings (e.g., sampling schemes) rather than a curated "basic →
advanced" teaching progression.
Usage
spesim_method_test(
init_file = NULL,
P = NULL,
seed = NULL,
write_outputs = FALSE,
output_prefix = NULL,
diagnostics = "nn",
make_tables = TRUE,
make_plots = TRUE,
...
)Arguments
- init_file
Optional path to an init file. If
NULL, uses the packaged exampleexamples/spesim_init_basic.txt.- P
Optional parameter list as returned by
load_config(). If supplied, it takes precedence overinit_file.- seed
Optional integer seed. If provided, overrides any seed in
P. IfNULL, the helper usesP$SEEDwhen available (so results are reproducible).- write_outputs
Logical. Passed to
spesim_run(). DefaultFALSE(fast; no files written).- output_prefix
Optional output prefix passed to
spesim_run(). Only used whenwrite_outputs = TRUE.- diagnostics
Diagnostics to compute in
spesim_audit(). Default"nn"for deterministic, dependency-minimal behaviour.- make_tables
Logical; if
TRUE, include standard analysis tables.- make_plots
Logical; if
TRUE, include standard plots.- ...
Additional arguments passed to
spesim_run().
Value
A list with elements:
res:spesim_resultreturned byspesim_run().audit: audit list returned byspesim_audit().tables(optional): named list of analysis tables (whenmake_tables = TRUE).plots(optional): named list of plots (whenmake_plots = TRUE).