nm_simulation: Generate a NONMEM control stream for simulations from a run

View source: R/nm_simulation.R

nm_simulationR Documentation

Generate a NONMEM control stream for simulations from a run

Description

Generates a NONMEM control stream for simulations from a source run.

Usage

nm_simulation(
  run,
  n_simulations = 100,
  seed = sample.int(1e+09, 1),
  output_table_format = ",1PE11.4",
  output_file = NULL
)

Arguments

run

pmxploit NONMEM run object of the source run.

n_simulations

integer. Number of simulations ($SIMULATION NSUBPROBLEMS) to run.

seed

integer. Seed number for random number generation.

output_table_format

(optional) character. NONMEM format (see NONMEM help) for the simulated output table. Default is ,1PE11.4, corresponding to a csv format.

output_file

(optional) character. File path to write the generated control stream to. Default is NULL, not saving any file.

Details

All THETA, OMEGA and SIGMA parameters will be fixed to the source run final estimates. $ESTIMATION record(s) will be replaced by a single $SIMULATION record (with the specified number of simulations). Simulated output will be saved to a single simtab file ($TABLE).

Value

A character string of the generated control stream code.

Examples


# Control stream generation from pmxploit::EXAMPLERUN
cs1 <- nm_simulation(EXAMPLERUN, n_simulations = 300)

# see the output
writeLines(cs1)

pnolain/pmxploit documentation built on Jan. 31, 2024, 1:16 p.m.