Pharmacokinetics

Non-compartmental pharmacokinetic analysis (NCA). AUC computation (linear, log-linear, linear-up/log-down), Cmax, Tmax, half-life, clearance, and volume of distribution.

Validates against R packages: PKNCA, NonCompart.

Non-compartmental pharmacokinetic analysis (NCA).

NCA is required for every PK study: AUC, Cmax, half-life, clearance, and volume of distribution. Self-contained, well-defined, formulaic calculations.

Phase 1: NCA only. Compartmental/PopPK is Phase 4+.

Validates against: R packages PKNCA, NonCompart.

class pystatsbio.pk.NCAResult(auc_last, auc_inf, auc_pct_extrap, cmax, tmax, half_life, lambda_z, lambda_z_r_squared, clearance, vz, dose, route, auc_method, n_points, n_terminal)[source]

Bases: object

Result of non-compartmental pharmacokinetic analysis.

Parameters:
auc_last: float
auc_inf: float | None
auc_pct_extrap: float | None
cmax: float
tmax: float
half_life: float | None
lambda_z: float | None
lambda_z_r_squared: float | None
clearance: float | None
vz: float | None
dose: float | None
route: str
auc_method: str
n_points: int
n_terminal: int
summary()[source]

Human-readable PK summary.

Return type:

str

pystatsbio.pk.nca(time, concentration, *, dose=None, route='ev', auc_method='linear-up/log-down', lambda_z_n_points=None)[source]

Non-compartmental pharmacokinetic analysis.

Parameters:
  • time (array) – Time points (non-negative, no duplicates).

  • concentration (array) – Plasma concentration values (non-negative).

  • dose (float or None) – Administered dose (needed for CL and Vz).

  • route (str) – 'iv' (intravenous bolus) or 'ev' (extravascular / oral).

  • auc_method (str) – 'linear' (linear trapezoidal), 'log-linear' (log-linear trapezoidal), 'linear-up/log-down' (linear up, log-linear down – the default, recommended by FDA guidance).

  • lambda_z_n_points (int or None) – Number of terminal points for half-life estimation. If None, automatically selects the best terminal phase (maximum adjusted r-squared with >= 3 points).

Returns:

Frozen dataclass with all NCA parameters.

Return type:

NCAResult

Notes

CPU-only. PK data is always small (typically 10-20 time points per subject).

Validates against: R PKNCA::pk.nca(), NonCompart::sNCA().