Repository navigation
Add petab.v2.reparametrize_log - #560
Merged
Merged
Conversation
dweindl
force-pushed
the
reparametrize-log
branch
from
October 19, 2026 14:44
e2290ab to
408403c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #560 +/- ##
==========================================
+ Coverage 78.44% 78.85% +0.41%
==========================================
Files 68 69 +1
Lines 7876 8043 +167
Branches 1406 1445 +39
==========================================
+ Hits 6178 6342 +164
Misses 1214 1214
- Partials 484 487 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dweindl
force-pushed
the
reparametrize-log
branch
2 times, most recently
from
October 19, 2026 15:26
74b7276 to
e74ee3b
Compare
This was referenced Oct 19, 2026
Merged
dweindl
marked this pull request as ready for review
October 20, 2026 06:22
dweindl
force-pushed
the
reparametrize-log
branch
4 times, most recently
from
October 20, 2026 14:56
e1d0f09 to
2c303c3
Compare
dilpath
approved these changes
Oct 20, 2026
dweindl
force-pushed
the
reparametrize-log
branch
2 times, most recently
from
October 21, 2026 12:22
7fc047b to
aa4298d
Compare
PEtab v2 has no `parameterScale`. To estimate a parameter `p` on log scale (and to specify priors for `log10(p)`), `p` has to be replaced by a new parameter `log10_p` with `p = 10^log10_p`. `reparametrize_log` does this for a given set of parameters on a copy of the problem and returns the copy and the mapping of old to new IDs: * parameter table: log-transformed bounds and nominal values (a lower bound or nominal value of 0 becomes -inf); priors given explicitly, or derived from `log-normal`, `log-laplace` and `log-uniform` priors * SBML model: new parameter `log10_p` and initial assignment `p = 10^log10_p` * observable/noise formulas and condition table target values: `p` -> `10^log10_p` * measurement table overrides: `p` -> `log10_p`, numeric overrides are log-transformed, and the placeholder `ph` -> `10^ph` in the formulas Base e is supported as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dweindl
force-pushed
the
reparametrize-log
branch
from
October 21, 2026 13:15
aa4298d to
98e2737
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PEtab v2 has no
parameterScale. To estimate a parameter<id>on log scale, or to specify a prior forlog10(<id>), the v2 spec recommends replacing<id>by a new parameterlog10_<id>with<id> = 10^log10_<id>.This adds
petab.v2.reparametrize_log(problem, parameter_ids, ...), which does this for the given parameters on a copy of the problem and returns the copy and the mapping of old to new parameter IDs:priorsargument, or derived fromlog-normal,log-laplaceandlog-uniformpriors on<id>(other priors on<id>raise; priors of non-estimated parameters raiseNotImplementedErrorunless dropped viapriors={<id>: None})log10_<id>and initial assignment<id> = 10^log10_<id>(replacing any existing one;<id>staysconstant=true)<id>→10^log10_<id>phis replaced by10^phin the formulasA lower bound of
0becomes-inf, following PEtab-dev/PEtab#682. If other estimated parameters have priors, such a parameter needs an explicit prior, since the defaultuniform(lb, ub)would be improper; otherwise, aValueErroris raised. A nominal value of0becomes-inf, assuming PEtab-dev/PEtab#685 is accepted, e.g., for parameters fixed at0.Problems with required extensions are not supported.
Base e (
log_<id>) is supported as well. The procedure follows the one described in the proposed v1→v2 migration guide (PEtab-dev/PEtab#680).Split off from #539, which uses this in
petab1to2(reparametrize=...)to preserve v1 parameter-scale priors.🤖 Generated with Claude Code