Hi Donald,
We are working on this in the new version. The internal time - dose_time subtraction can introduce tiny floating-point differences (e.g., 99.9999 - 72.0 = 27.999899999999997 instead of 27.9999). Previously, this could flip interpolation to extrapolation, requiring lambda_z and producing missing when it wasn’t estimable. Now, we are considering a floating-point tolerance clamps these near-misses back, so your workaround of manually rounding TAD values should no longer be necessary.
using NCA, DataFrames
df = DataFrame(
id = 1,
concentration = [missing, 5.0, 2.0, 0.3],
time = [72.0, 73.0, 74.0, 99.9999],
dose = [100.0, missing, missing, missing],
route = "ev",
)
df_r = NCA.read_nca_interleaved(df)
report = run_nca(
df_r,
[
:lambdaz,
:tfinal,
:auc_partial => (; interval = (0.0, 27.9999)) => :auc_at_tfinal,
:auc_partial => (; interval = (0.0, 28.001)) => :auc_beyond,
],
)
println("lambdaz: ", report.lambdaz[1])
println("tfinal: ", repr(report.tfinal[1]))
println("auc_partial (0, 27.9999): ", report.auc_at_tfinal[1])
println("auc_partial (0, 28.001): ", report.auc_beyond[1])
lambdaz: missing
tfinal: 27.999899999999997
auc_partial (0, 27.9999): 35.899885
auc_partial (0, 28.001): missing
The 27.9999 endpoint is recognized as matching tfinal despite the floating-point mismatch. The 28.001 endpoint is genuinely beyond the data and correctly returns missing since lambda_z is not estimable.