# Reporting NCA bugs

**URL:** <https://discourse.pumas.ai/t/reporting-nca-bugs/1379>\
**Category:** NCA\
**Created:** [February 18, 2026, 8:48pm UTC](https://discourse.pumas.ai/t/reporting-nca-bugs/1379 "2026-02-18T20:48:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donald](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/donald/32/785_2.png) [@Donald](https://discourse.pumas.ai/u/Donald)\
**Post date:** [February 18, 2026, 8:48pm UTC](https://discourse.pumas.ai/t/reporting-nca-bugs/1379/1 "2026-02-18T20:48:18Z")

</div>

Hello,

Just noticed a couple bugs I’d like to report.

`NCA.cmin(ncapop; interval = (t1, t2)` gives all values as `missing`, while `NCA.clast` doesn’t.

`AUCinf_obs` and `AUCinf_pred` came out incorrect for a given subject. I noticed when mean and geomean for a partial AUC came out slightly greater than the AUCinf, and found that a single subject had much smaller AUCinf than partial AUC.

---

<div class="post-metadata">

**Author:** ![ArnoStrouwen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/arnostrouwen/32/185_2.png) [@ArnoStrouwen](https://discourse.pumas.ai/u/ArnoStrouwen)\
**Post date:** [February 19, 2026, 7:26am UTC](https://discourse.pumas.ai/t/reporting-nca-bugs/1379/2 "2026-02-19T07:26:53Z")

</div>

Hello Donald,

PumasAI is working on a new version of NCA that fixes many of these issues.  
Do you have any reproducer datasets that show these issues?  
Then I will check that the issues are resolved in the next release.

---

<div class="post-metadata">

**Author:** ![Donald](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/donald/32/785_2.png) [@Donald](https://discourse.pumas.ai/u/Donald)\
**Post date:** [February 25, 2026, 12:34am UTC](https://discourse.pumas.ai/t/reporting-nca-bugs/1379/3 "2026-02-25T00:34:31Z")

</div>

Hi Arno,

Thank you for the response. I have generated a reproducer data set:

```auto
ID	TAD	DV	AMT	ROUTE
1	0 15	EV
1	0.017	840		
1	2	1350		
1	4	1450		
1	8	1388		
1	12	1200		
1	24	1100		
1	72	399		

```

And here is the code:

```auto
df.AMT = df.AMT .* 10^6
df.DV = df.DV ./ 1000

pop = read_nca(df,
            id = :ID,
            time = :TAD,
            observations = :DV,
            amt = :AMT,
            route = :ROUTE)

auc0_72_df = NCA.auc(pop; interval = (0, 3*24))
auc0_648_df = NCA.auc(pop; interval = (0, 27*24))
aucinf_df = NCA.auc(pop)

```

This subject discontinued early. AUC0\_72 and AUCinf are giving me the same results, and the AUC0\_648 is adding values, despite no concentration data past 72 hrs. Both of these results appear to be bugs.

---

<div class="post-metadata">

**Author:** ![ArnoStrouwen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/arnostrouwen/32/185_2.png) [@ArnoStrouwen](https://discourse.pumas.ai/u/ArnoStrouwen)\
**Post date:** [March 16, 2026, 4:49am UTC](https://discourse.pumas.ai/t/reporting-nca-bugs/1379/4 "2026-03-16T04:49:58Z")

</div>

In an upcoming breaking release of NCA these computations will give much more sensible values.

```auto
using DataFrames
using NCA

df = DataFrame(
id = 1,
time = [0, 0.017, 2, 4, 8, 12, 24, 72],
concentration = [missing, 840.0, 1350, 1450, 1388, 1200, 1100, 399],
dose = [15e6, missing, missing, missing, missing, missing, missing, missing],
route = “ev”,
)

pop = NCA.read_nca_interleaved(df)

report = run_nca(pop, [
:auclast,
:aucinf_pred,
:auc_partial => (; interval = (0, 72)) => :auc_0_72,
:auc_partial => (; interval = (0, 648)) => :auc_0_648,
:auc_partial => (; interval = (0, Inf)) => :auc_0_inf,
])

```

```auto
julia> auclast_val = report.auclast[1]
65606.525

julia> aucinf_val = report.aucinf_pred[1]
86720.28433577472

julia> auc_0_72 = report.auc_0_72[1]
65606.525

julia> auc_0_648 = report.auc_0_648[1]
86427.74510262541

julia> auc_0_inf = report.auc_0_inf[1]
86720.28433577472

```

Do these results match your expectations?  
Areas past the last observation are based on extrapolating concentration values with an estimated terminal elimination rate, lambda\_z.

---

<div class="post-metadata">

**Author:** ![Donald](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/donald/32/785_2.png) [@Donald](https://discourse.pumas.ai/u/Donald)\
**Post date:** [March 26, 2026, 9:18pm UTC](https://discourse.pumas.ai/t/reporting-nca-bugs/1379/5 "2026-03-26T21:18:22Z")

</div>

Hi Arno,

Yes, that matches my expectation.

I have another bug to report. I’m not sure whether the NCA behavior has changed with the latest update, but in Pumas 2.8, it seems that partial AUC will now be missing if the concentrations are zero at the time of end of the interval. I’m setting all BLQ values to 0 concentration, and those subjects with trailing zero concentrations will have partial AUC that are missing.

---

<div class="post-metadata">

**Author:** ![ArnoStrouwen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/arnostrouwen/32/185_2.png) [@ArnoStrouwen](https://discourse.pumas.ai/u/ArnoStrouwen)\
**Post date:** [March 28, 2026, 7:21pm UTC](https://discourse.pumas.ai/t/reporting-nca-bugs/1379/6 "2026-03-28T19:21:47Z")

</div>

The upcoming release will also have completely reworked AUC calculations.

Here is a trailing zero example:

```auto
julia> using NCA, DataFrames
df = DataFrame(
id = 1,
concentration = [0.0, 8.0, 5.0, 2.0, 0.5, 0.0, 0.0, 0.0, 0.0],
time = [0.0, 0.5, 1.0, 2.0, 4.0, 8.0, 12.0, 16.0, 24.0],
dose = [100.0, fill(missing, 8)…],
route = “ev”,
)

   report = run_nca(
     NCA.read_nca_interleaved(df),
     [
       :tlast,
       :tfinal,
       :lambdaz,
       :auc_partial => (; interval = (0.0, 12.0)) => :auc_0_12,
       :auc_partial => (; interval = (0.0, 24.0)) => :auc_0_24,
       :auc_partial => (; interval = (12.0, 24.0)) => :auc_12_24,
     ],
   )
   
   println("auc_partial 0-12: ", report.auc_0_12[1])
   println("auc_partial 0-24: ", report.auc_0_24[1])
   println("auc_partial 12-24: ", report.auc_12_24[1])

```

`auc_partial 0-12: 12.25 auc_partial 0-24: 12.25 auc_partial 12-24: 0.0`

Anything specific you want me to test?

---

<div class="post-metadata">

**Author:** ![donaldlee3](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/donaldlee3/32/165_2.png) [@donaldlee3](https://discourse.pumas.ai/u/donaldlee3)\
**Post date:** [March 28, 2026, 7:52pm UTC](https://discourse.pumas.ai/t/reporting-nca-bugs/1379/7 "2026-03-28T19:52:50Z")

</div>

Thank you, Arno. That’s perfect.

The only other issue with NCA I recall is with numerical issues as I posted a couple years ago here:

> [@AUC bug with interval](https://discourse.pumas.ai/t/auc-bug-with-interval/990/3):
>
> Hi @vijay, I’ve identified the source of the problem. I have multiple dose data and group by occasion, as opposed to using ii. I still give the read\_NCA time = :time as opposed to time = :tad. It appears that the auc function with a time interval is calculating tad itself for all the occasions, which is resulting in numerical/decimal issues. For example, my last tad should be 27.9999, but if I manually create my own tad column, and give time = :tad to read\_NCA, I will get missing from the a…

Has this been fixed?

---

<div class="post-metadata">

**Author:** ![ArnoStrouwen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/arnostrouwen/32/185_2.png) [@ArnoStrouwen](https://discourse.pumas.ai/u/ArnoStrouwen)\
**Post date:** [March 28, 2026, 9:39pm UTC](https://discourse.pumas.ai/t/reporting-nca-bugs/1379/8 "2026-03-28T21:39:34Z")

</div>

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.

```auto
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])

```

```auto
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.
