Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #539 +/- ##
==========================================
+ Coverage 77.98% 78.85% +0.87%
==========================================
Files 68 69 +1
Lines 7791 8055 +264
Branches 1390 1461 +71
==========================================
+ Hits 6076 6352 +276
+ Misses 1227 1213 -14
- Partials 488 490 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PEtab v2 has no `parameterScale`. Converting a v1 `parameterScaleNormal` prior on a log-scaled parameter to `log-normal` keeps the prior distribution, but adds a Jacobian term to the MAP objective and moves the optimum. No v2 prior over the unscaled parameter can preserve both. Add `petab.v2.reparametrize_log`, which estimates `log10_<id>` (or `log_<id>`) instead of `<id>` and defines `<id> = 10^log10_<id>`: * parameter table: log-transformed bounds and nominal value; priors are taken from the `priors` argument or derived from `log-normal`, `log-laplace` and `log-uniform` priors * SBML model: new parameter and assignment rule for model parameters * observable/noise formulas and condition target values: substitution * measurement overrides: replaced by the new IDs, numbers are log-transformed, and the placeholder is exponentiated in the formula `petab1to2` and `petab_files_1to2` get a `reparametrize` argument: `"none"` (default, current behaviour), `"priors"` (log-scaled parameters with `parameterScale*` priors) or `"all"` (all estimated log-scaled parameters without priors on linear scale). Log-scaled parameters that share a placeholder with selected parameters are added. With `"all"`, parameters without parameter-scale priors are skipped if their placeholder can't be log-transformed. With `"none"`, a warning points to the new option. References Benchmarking-Initiative/Benchmark-Models-PEtab#333 Generated with AI assistance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dweindl
force-pushed
the
petab1to2-reparametrize-log
branch
from
October 15, 2026 12:00
2f22c43 to
bdad27e
Compare
Report all affected placeholders at once, by ID, together with the reparametrized parameters overriding them. Separate overrides by parameters that are not reparametrized (which can be fixed by including them in `parameter_ids`) from non-positive numbers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`math.log(x) / math.log(10)` is inexact for powers of 10 (e.g. `2.9999999999999996` for 1000), which gave bounds and log-uniform prior parameters that differ from those computed with `log10` elsewhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In `reparametrize_log`, define `p = base^q` by an initial assignment instead of an assignment rule. `q` is a parameter table parameter and therefore constant during the simulation, so `p` keeps its `constant=true` attribute and stays a constant entity in the sense of the PEtab v2 spec (e.g., it can still be a condition target). An existing initial assignment for `p` is replaced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PEtab v1 allows a lower bound of 0 for log-scaled parameters if an initialization prior is given. On log scale, this would be `-inf`, for which `reparametrize_log` raises, and neither the v1 default prior nor `parameterScaleUniform` would be proper. Instead of failing the whole conversion, keep such parameters on linear scale and warn. Generated with AI assistance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* `petab1to2`: also warn about converted `parameterScaleUniform` priors with `reparametrize="none"`, which change the maximum a posteriori estimate as well * `petab1to2`: point to `reparametrize="none"` if reparametrization fails, and drop the `parameter_ids` hint from the `reparametrize_log` error, which doesn't apply there * `petab1to2`: warn once about parameters skipped because of placeholders, not once per base * `reparametrize_log`: ignore non-positive bounds of non-estimated parameters, and raise `NotImplementedError` for SBML models before L2V2, which have no initial assignments * tests: likelihood after reparametrizing overrides with both bases, and the benchmark collection with `reparametrize="all"` Generated with AI assistance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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. Converting a v1parameterScaleNormal(μ, σ)prior on alog10-scaled parameter tolog-normal(μ ln10, σ ln10)keeps the prior distribution, but adds a Jacobian term to the v2 MAP objective, which moves the optimum by−σ² ln10decades. No v2 prior over the unscaled parameter can preserve both the distribution and the optimum.This adds
petab.v2.reparametrize_log, which estimateslog10_<id>(orlog_<id>) instead of<id>and defines<id> = 10^log10_<id>, as recommended by the v2 spec for log-scale priors:priorsargument, or derived fromlog-normal,log-laplaceandlog-uniformpriors (other x-space priors raise)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 formulaspetab1to2andpetab_files_1to2get areparametrizeargument:"none"(default): current behaviour, now with a warning for convertedparameterScale*priors"priors": log-scaled parameters withparameterScale*priors"all": all estimated log-scaled parameters without x-space priors; this also preserves the v1 default prior (uniform on parameter scale)Log-scaled parameters sharing a placeholder with selected parameters are added. With
"all", parameters without parameter-scale priors are skipped (with a warning) if their placeholder can't be log-transformed (e.g., Bachmann has0offsets). Parameters withlowerBound = 0(allowed in v1 for log-scaled parameters with an initialization prior) are skipped with a warning, as their lower bound on log scale would be-inf.Checked on the benchmark collection: all 35 problems convert and pass v2 linting with
"all"(now also tested in CI); with"priors", 44 parameters are reparametrized in Bachmann, Isensee, Raimundez and Schwen. Objective equivalence with a simulator is not checked here (to be done in AMICI / the benchmark repo).Open point: default stays
"none"until Benchmarking-Initiative/Benchmark-Models-PEtab#333 is decided.References Benchmarking-Initiative/Benchmark-Models-PEtab#333
🤖 Generated with Claude Code