Skip to content

openpkflow.validation

Utility functions for cross-checking openpkflow output against reference values.

Public API

Symbol Type Description
pct_bias(observed, reference) function Percent bias: (obs - ref) / ref * 100
rmse(observed, reference) function Root mean squared error
within_pct(observed, reference, pct) function True if |pct_bias| <= pct

Example

from openpkflow.validation import pct_bias, within_pct

# Check that NCA-recovered CL is within 5% of true CL
true_cl = 5.0
recovered_cl = 5.12
print(pct_bias(recovered_cl, true_cl))    # 2.4
print(within_pct(recovered_cl, true_cl, pct=5.0))  # True

Validation strategy

OpenPKFlow validation tests simulate synthetic PK profiles from exact analytical equations (where truth is known), run NCA on the simulated data, and verify that recovered parameters match the true inputs within a specified tolerance.

See tests/validation/ for the full test suite.