Module auc

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(&times, &concs, &AUCMethod::Linear).unwrap();
let partial = auc_interval(&times, &concs, 1.0, 4.0, &AUCMethod::Linear).unwrap();
let moment = aumc(&times, &concs, &AUCMethod::Linear).unwrap();
let c_at_3 = interpolate_linear(&times, &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.