From 837594ea8cbbbb75d3e818e9463e1ef082a67283 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Mon, 13 Apr 2026 14:06:53 +0000 Subject: [PATCH] Update NEWS.md with recent bug fixes for ED calculations Agent-Logs-Url: https://github.com/hreinwald/drc/sessions/c2724f6d-4710-447d-8218-01d00de1d28d Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com> --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index ff5cc62..e5dc4c5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,10 @@ ## New Features * Enhanced `plot.drc()`: error bars in `type = "bars"` plots now match curve colors by default. Added `errbar.col` parameter to allow manual control of error bar colors. Set `errbar.col = "black"` to restore the previous behavior of black error bars. +## Bug Fixes +* Fixed `logistic()` model ED calculation with `type="absolute"`: the `edfct` function now correctly handles absolute-to-relative conversion without applying the incorrect p-swap from `EDhelper()`. The logistic model has opposite b-sign convention from log-logistic (b < 0 means increasing, not decreasing), so `EDhelper`'s p-swap for b < 0 would incorrectly swap ED values. The fix uses inline absolute-to-relative conversion (`p = 100·(d−respl)/(d−c)`) for absolute type and `p = respl` directly for relative type. +* Fixed model-level `edfct` derivatives for absolute ED type in `braincousens()`, `fplogistic()`, `llogistic()`, `llogistic2()`, `lnormal()`, `weibull1()`, and `weibull2()`: when `type = "absolute"`, the gradient functions previously set ∂ED/∂c and ∂ED/∂d to 0, which was incorrect because the absolute-to-relative conversion makes p a function of c and d. The chain rule requires non-zero partials. Now compute ∂ED/∂c and ∂ED/∂d via central differences on a closure that captures the chain-rule contribution through the full ED computation path. + --- # drc 3.3.0.03