You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The constant model in dose_response uses a second optimizer for the same likelihood #85
tl/_dose.py maximises the same Student-t likelihood with two different optimizers. _fit_maximum_likelihood runs Nelder-Mead over a model's parameters plus the error scale, and _fit_maximum_likelihood_constant runs minimize_scalar(method="bounded") over the error scale alone, with a
hand-picked upper bound of std * 100 that nothing else in the file uses.
The constant model is the zero-response model once the baseline is subtracted, so it is the same objective with
an empty parameter vector. Making it a third entry in _winning_model's model set would delete the function,
the minimize_scalar import, the bounds heuristic, and the if constant is None branch in _hitcall.
Expected behaviour
One optimizer for one likelihood.
Note this is not a pure refactor: bounded Brent and Nelder-Mead will not land on bit-identical optima, so the
P1 term of every hitcall moves in the last digits. It needs the dose tests re-run and the tutorial 11 outputs
regenerated, which is why it was left out of the cleanup that introduced the dataclass.
Related
The _Fit dataclass added in 337dbcb already carries what a "constant" entry would need: a name, a parameter
vector whose last element is the error scale, and a predict.
Activity
Fit the constant model with the optimizer the curves use (#112)