Skip to content

v2: handle infinite parameter bounds (PEtab 2.0 erratum E1) - #601

Open
dweindl wants to merge 1 commit into
PEtab-dev:mainfrom
dweindl:worktree-565
Open

dweindl wants to merge 1 commit into
PEtab-dev:mainfrom
dweindl:worktree-565

Conversation

@dweindl

@dweindl dweindl commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Implements PEtab 2.0.0 erratum E1: lowerBound may be -inf, upperBound may be inf, and if any estimated parameter has a prior, estimated parameters with infinite bounds need an explicit proper prior.

  • Parameter.lb must be finite or -inf, Parameter.ub finite or inf. Previously, e.g. lb=ub=inf was accepted.
  • CheckPriorDistribution reports estimated parameters with infinite bounds and no prior if the problem has a MAP objective. Explicit improper uniform/log-uniform priors (e.g., with infinite prior parameters) are already rejected via Reject improper Uniform and LogUniform distributions #604.
  • Problem.get_priors and Problem.get_startpoint_distributions raise a ValueError naming the parameters with infinite (or missing) bounds and no prior, instead of the generic error from Uniform (since Reject improper Uniform and LogUniform distributions #604) or, before that, an improper Uniform that failed on sampling. I chose this over adding a fallback-distribution argument to keep the API unchanged; a fallback could be added later if needed.
  • Problem.sample_parameter_startpoints used get_priors, which is empty for maximum likelihood problems, and thus always failed for them. It now uses get_startpoint_distributions (identical to get_priors for MAP problems). It also returns an (n_starts, 0) array if no parameters are estimated, and no longer accepts arbitrary keyword arguments. These were a leftover from copying the v1 method, where they are forwarded to petab.v1.sampling.sample_parameter_startpoints; in v2 they have been silently ignored since v2: Startpoint sampling #380, so nothing should depend on them.
  • Tests that prior truncation at bounds matching the prior's domain (e.g., log-normal on [0, inf]) is a no-op, and that one-sided infinite bounds still truncate at the finite bound.

Infinite nominal values (erratum E3) were already accepted; no change.

Closes #565.

🤖 Generated with Claude Code

@dweindl dweindl self-assigned this Nov 17, 2026
@codecov-commenter

codecov-commenter commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.13%. Comparing base (4329d1b) to head (799768f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #601      +/-   ##
==========================================
+ Coverage   79.93%   80.13%   +0.20%     
==========================================
  Files          70       70              
  Lines        8362     8429      +67     
  Branches     1519     1544      +25     
==========================================
+ Hits         6684     6755      +71     
+ Misses       1188     1183       -5     
- Partials      490      491       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

PEtab 2.0.0 erratum E1 allows `lowerBound=-inf` and `upperBound=inf`.
If any estimated parameter has a prior, estimated parameters with
infinite bounds require an explicit proper prior, since the default
`uniform(lowerBound, upperBound)` prior would be improper.

* `Parameter.lb` must be finite or `-inf`, `Parameter.ub` finite or
  `inf`. Errors refer to the `lowerBound`/`upperBound` columns.
* `CheckPriorDistribution` reports estimated parameters with infinite
  bounds and no prior if the problem has a MAP objective.
* `Problem.get_startpoint_distributions` raises a `ValueError` naming
  estimated parameters with infinite or missing bounds and no prior,
  instead of returning improper uniform distributions. `get_priors`
  delegates to it for MAP problems.
* `Problem.sample_parameter_startpoints` used `get_priors`, which is
  empty for maximum likelihood problems, and thus failed. It now uses
  `get_startpoint_distributions`, returns an `(n_starts, 0)` array if no
  parameters are estimated, and no longer accepts and ignores arbitrary
  keyword arguments.
* Test that prior truncation at bounds matching the prior's domain is a
  no-op, and that one-sided infinite bounds still truncate.

Closes PEtab-dev#565.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dweindl
dweindl marked this pull request as ready for review November 17, 2026 16:16
@dweindl
dweindl requested a review from a team as a code owner November 17, 2026 16:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2: Update parameter table validation for PEtab 2.0 erratum E1 (infinite bounds)

2 participants