I found some bigger issues in the ucedergreen() function. I posted the issue in my drc re-factory repo as well.
1. Core Model Function (fct) — Missing + c term
The documented formula is:
$f(x) = c + d - \frac{d - c + f \exp(-1/x^{\alpha})}{1 + \exp(b(\log(x) - \log(e)))}$
The code computes only $d - \text{numTerm}/\text{denTerm}$, missing parmMat[, 2].
The fix is a single token: parmMat[, 2] + parmMat[, 3] - numTerm/denTerm.
2. edfct Signature Mismatch
The drc framework calls edfct(parm, respl, reference, type, ...) positionally.
ucedergreen() defines edfct(parm, p, ...), dropping reference and type entirely.
This will silently break ED calculations at runtime.
3. xlogx Called but Never Defined
deriv1 calls xlogx(...) but the helper is commented out. Any call to deriv1
will throw Error: could not find function "xlogx".
4. match.arg(method) Never Called
Unlike cedergreen(), ucedergreen() never validates the method argument.
Invalid strings pass silently and the default first-element selection never triggers.
5. | Instead of || in Argument Validation
Scalar if() guards use the vectorized | operator instead of the short-circuit ||,
which is a latent bug and produces warnings on non-scalar inputs.
I found some bigger issues in the
ucedergreen()function. I posted the issue in my drc re-factory repo as well.1. Core Model Function (
fct) — Missing+ ctermThe documented formula is:
The code computes only$d - \text{numTerm}/\text{denTerm}$ , missing
parmMat[, 2].The fix is a single token:
parmMat[, 2] + parmMat[, 3] - numTerm/denTerm.2.
edfctSignature MismatchThe
drcframework callsedfct(parm, respl, reference, type, ...)positionally.ucedergreen()definesedfct(parm, p, ...), droppingreferenceandtypeentirely.This will silently break ED calculations at runtime.
3.
xlogxCalled but Never Definedderiv1callsxlogx(...)but the helper is commented out. Any call toderiv1will throw
Error: could not find function "xlogx".4.
match.arg(method)Never CalledUnlike
cedergreen(),ucedergreen()never validates themethodargument.Invalid strings pass silently and the default first-element selection never triggers.
5.
|Instead of||in Argument ValidationScalar
if()guards use the vectorized|operator instead of the short-circuit||,which is a latent bug and produces warnings on non-scalar inputs.