Learn R Programming

nlmixr2auto (version 1.0.0)

auto_param_table: Automatically generate a parameter table with initial estimates

Description

Constructs a parameter table for nlmixr2 model fitting. It supports:

  • Direct use of a user-provided parameter table.

  • Automatic initialization of parameters from data using getPPKinits().

  • Fallback to a default parameter table created by initialize_param_table().

Usage

auto_param_table(
  dat = NULL,
  param_table = NULL,
  nlmixr2autoinits = TRUE,
  foldername = NULL,
  filename = "test",
  out.inits = TRUE,
  ...
)

Value

A data.frame representing the parameter table with initial estimates, ready for use in nlmixr2().

Arguments

dat

A data frame containing observed data (required if nlmixr2autoinits = TRUE).

param_table

Optional. A user-provided parameter table (if provided, all other logic is skipped).

nlmixr2autoinits

Logical. Whether to automatically estimate initial values using getPPKinits(). Default is TRUE.

foldername

Character string specifying the folder name for storing nlmixr2autoinits outputs. If NULL (default), tempdir() is used for temporary storage. If specified, a cache directory is created in the current working directory.

filename

Character string specifying the base name for model output files generated during evaluation.

out.inits

Logical flag indicating whether the results returned by the automated initialization procedure should be saved to an RDS file. When TRUE, the output of the initialization step is written to disk for reproducibility or debugging purposes.

...

Additional arguments passed to getPPKinits().

Author

Zhonghui Huang

Details

When nlmixr2autoinits = TRUE, this function estimates initial values from data, applies a name mapping to internal model parameters, performs log transformations where appropriate, and replaces problematic log values (e.g. log(0) or NA) with log(0.01) for numerical stability.

See Also

getPPKinits, initialize_param_table

Examples

Run this code
# \donttest{
auto_param_table(dat = pheno_sd)
# }

Run the code above in your browser using DataLab