intervals¶
Parameters of the single dosing intervals of a multiple dose timecourse.
A dosing protocol with the dose times \(t_1 < \dots < t_K\) splits a timecourse
into the dosing intervals \([t_k, t_{k+1}]\) and the last interval
\([t_K, t_K + \tau_K]\), whose length comes from the protocol or from
NCAOptions.tau. compute_intervals computes the exposure of every interval
of every row of a batch, the analysis of a multiple dose curve of
Gabrielsson & Weiner (2016, ch. 2.8) and Rowland & Tozer (2011, ch. 11):
AUC(0-tau)of the interval, with the values at its bounds interpolated so that samples outside it add no area,Cmax,Tmax(relative to the start of the interval),Cmin,Ctrough, the value at the end of the interval, andCstart, the value at its start (after an intravenous bolus the post-dose value; the pre-dose value of intervalkis theCtroughof intervalk-1),Cavg = AUC(0-tau) / tau,fluctuation = (Cmax - Cmin) / Cavgandswing = (Cmax - Cmin) / Cmin,
and, for effect timecourses, AUEC(0-tau), Emax, TEmax, Emin, Eavg
and the time above NCAOptions.effect_threshold.
The variables are named with the prefix interval_ and live over the extra
dimension interval of a result, so that they do not clash with the single
dose and the steady state parameters of the same curve.
The bounds of an interval. The value at the start and the value at the end
are interpolated from the curve (pkpdutils.nca.auc.interpolate_at), which
returns an observed value when a sample was taken at the bound. Two cases need
more than an interpolation:
- after an intravenous bolus the concentration jumps at the dose. An interval
which starts before the first sample of the curve therefore gets the
log-linearly back-extrapolated
C0of its first two samples, the estimatecompute_parametersuses for the single dose areas. - an interval whose end carries the next bolus ends before that dose, so a
sample recorded exactly at its end may be a post-dose sample of the next
dose. It is taken as such only when it lies above the last sample inside the
interval, which no decline can do; the trough is then the log-linear
regression of the last (up to three) positive samples inside the interval
evaluated at the end of the interval, and the row carries
pkpdutils.nca.options.NCAFlag.EXTRAPOLATED_TROUGH. Every other sample at the end, and every interpolated end value, is the observed trough and is used as it is; the substitution never applies to another route, since only a bolus makes the concentration jump. - an interval whose end is not covered by the data, or which holds no sample at
all, is incomplete: its parameters are
NaNand only the number of samples is reported (pkpdutils.nca.options.NCAFlag.INCOMPLETE_INTERVALfor the last interval).
interval_n_points counts the samples the interval uses; a sample at a
boundary is used by both neighbouring intervals, so the counts of the
intervals of a curve do not partition its samples.
interval_variables
¶
Names of the interval variables of an analysis, in the order of the result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
options
|
NCAOptions
|
the options, |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
has_dose |
bool
|
whether the batch carries dose amounts ( |
Returns:
| Type | Description |
|---|---|
tuple[str, ...]
|
The variable names. |
compute_intervals
¶
Parameters of every dosing interval of every row of a batch.
Interval k of a row runs from the dose time t_k to the next dose time
t_{k+1}, the last one from t_K to t_K + tau. The rows are vectorized
and the (few) intervals are looped over; a row with fewer doses than the
widest protocol of the batch has NaN in its trailing columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
ndarray
|
times |
required |
c
|
ndarray
|
values |
required |
Other Parameters:
| Name | Type | Description |
|---|---|---|
dose_amount |
ndarray | None
|
dose amounts |
dose_time |
ndarray
|
dose times |
tau |
ndarray
|
length of the last interval per row |
route |
Route | None
|
route of the batch |
options |
NCAOptions
|
the options |
Returns:
| Type | Description |
|---|---|
dict[str, ndarray]
|
One |
ndarray
|
mask |
tuple[dict[str, ndarray], ndarray]
|
was extrapolated ( |