Examples
Selected documentation pages for the example suite. The repository currently ships 34 self-contained example scripts covering common population PK/PD workflows, while the docs below cover a curated subset of those scripts in worked-example form. All shipped scripts can be run directly:
python examples/01_theophylline_fo.py
Set OPENPKPD_EXAMPLE_OUTPUT=/tmp/figs to save figures to disk instead
of displaying them interactively.
Basic PK modelling
Script |
Topic |
|---|---|
|
One-compartment oral model, FO estimation |
|
Warfarin FOCE with interaction |
|
Two-compartment IV bolus, ADVAN3 |
|
Three-compartment IV with ADVAN11 |
PD and PKPD models
Script |
Topic |
|---|---|
|
Direct Emax PD effect |
|
Indirect-response simulation with an approximate direct-effect fit |
|
Poisson/NegBin/ZIP count models; proportional odds, Markov state models |
|
Effect compartment, turnover, TGI (Simeoni), placebo response |
Special features
Script |
Topic |
|---|---|
|
Parse and run an existing NONMEM |
|
ODE-based transit absorption |
|
Below-limit-of-quantification (M1/M3/M5) |
|
Time-to-event survival model |
|
Delay differential equation (DDE) PK model |
|
SBML/QSP model import |
|
5-organ physiologically-based PK (PBPK) model |
|
Inter-occasion variability (IOV) modelling |
|
FOCEI optimizer robustness controls from the Python API |
|
Inspect FOCEI optimizer extensions from a control stream |
|
Neonatal phenobarbital population PK with weight scaling |
|
NCA on the public Indometh WinNonlin-backed dataset |
|
PFIM-backed sampling-time optimization |
|
Four-compartment ADVAN5 example with ADVAN11 consistency check |
|
Short IMPMAP warm-start diagnostics on warfarin PK |
|
Synthetic nonparametric support-point estimation demo |
|
Full TMDD / QSSA / Michaelis-Menten approximation comparison |
|
Multi-dose steady-state NCA (AUCtau, Ctrough, accumulation ratio) |
Estimation methods
Script |
Topic |
|---|---|
|
FO estimation |
|
FOCE with interaction |
|
Bayesian Laplace approximation (PyMC optional) |
|
SAEM (stochastic EM) with convergence history |
|
Laplacian estimation + prior augmentation (MAP) |
Analysis workflows
Script |
Topic |
|---|---|
|
GOF, spaghetti, ETA diagnostic panels |
|
Non-compartmental analysis (NCA) |
|
Stepwise covariate modelling (SCM) |
|
Visual Predictive Check (VPC) |
|
Parallel bootstrap resampling |
- Example 1 — Theophylline (FO)
- Example 2 — Warfarin (FOCE)
- Example 3 — Two-Compartment IV (ADVAN3)
- Example 4 — Emax PD Model
- Example 5 — Indirect Response Model
- Example 6 — Running a Control Stream File
- Example 7 — Full Diagnostic Plot Gallery
- Example 8 — FOCEI Optimizer Controls from Python
- Example 9 — FOCEI Optimizer Controls from a Control Stream
- Example 29 — Optimal Design with PFIM
- Example 16: Delay Differential Equation (DDE) PK model
- Example 20 — SAEM Estimation
- Example 22 — PBPK Modelling
- Example 31 — IMPMAP Warm-Start Diagnostics
- Example 32 — Nonparametric Support Points
- Example 33 — TMDD Model Comparison
- Example 34 — Multi-Dose Steady-State NCA