Module auc
Expand description
Trapezoidal AUC/AUMC calculation on &[f64] slices.
Building blocks for ObservationProfile
and NCA analysis. Supports linear, lin-up/log-down, and lin-log methods.
use pharmsol::data::auc::{auc, auc_interval, aumc, interpolate_linear};
use pharmsol::prelude::AUCMethod;
let times = [0.0, 1.0, 2.0, 4.0, 8.0];
let concs = [0.0, 10.0, 8.0, 4.0, 2.0];
let total = auc(×, &concs, &AUCMethod::Linear).unwrap();
let partial = auc_interval(×, &concs, 1.0, 4.0, &AUCMethod::Linear).unwrap();
let moment = aumc(×, &concs, &AUCMethod::Linear).unwrap();
let c_at_3 = interpolate_linear(×, &concs, 3.0).unwrap();Functions§
- auc
- ∫ C(t) dt from first to last time point. Tmax is auto-detected for
LinLog. - auc_
interval - Partial AUC over
[start, end], interpolating at boundaries. - auc_
segment - Calculate AUC for a single segment between two time points
- auc_
segment_ with_ tmax - Calculate AUC for a segment with Tmax context (for LinLog method)
- aumc
- ∫ t·C(t) dt from first to last time point (for MRT = AUMC / AUC).
- aumc_
segment_ with_ tmax - Calculate AUMC for a segment with Tmax context (for LinLog method)
- interpolate_
linear - Linearly interpolate a value at
time. Clamps to boundary values.