Parses a .ferx file without fitting and prints a compact summary of its model structure: PK model type, inter-individual variability (IIV), inter-occasion variability (IOV), and residual error type. Useful for verifying that a model file will be interpreted as expected before committing to a potentially long estimation run.

ferx_model_inspect(path)

Arguments

path

Path to a .ferx model file, or a ferx_fit object returned by ferx_fit.

Value

A named list (invisibly) with fields: theta_names (character vector of population parameter names), model_type (short label such as "1-cpt oral" or NULL when not unambiguously detectable), iiv (omega names), iov (kappa names), and residual (error type).

Details

Alternatively, pass a ferx_fit object to display the structure that was auto-derived during fitting (reads fit$model_structure directly, so no file path is needed post-fit).

Examples

ex <- ferx_example("warfarin")
ferx_model_inspect(ex$model)
#> Model structure (warfarin.ferx)
#>   Structural:  1-cpt oral  (TVCL, TVV, TVKA)
#>   IIV:         ETA_CL, ETA_V, ETA_KA
#>   IOV:         none
#>   Residual:    proportional

# Programmatic access
s <- ferx_model_inspect(ex$model)
#> Model structure (warfarin.ferx)
#>   Structural:  1-cpt oral  (TVCL, TVV, TVKA)
#>   IIV:         ETA_CL, ETA_V, ETA_KA
#>   IOV:         none
#>   Residual:    proportional
s$theta_names  # c("TVCL", "TVV", "TVKA")
#> [1] "TVCL" "TVV"  "TVKA"
s$model_type   # "1-cpt oral"
#> [1] "1-cpt oral"
s$iiv          # c("ETA_CL", "ETA_V", "ETA_KA")
#> [1] "ETA_CL" "ETA_V"  "ETA_KA"
s$residual     # "proportional"
#> [1] "proportional"