Skip to content

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Apr 25, 2025

  • Add Parameter.prior_dist
  • Update v1.distributions.__all__
  • Implement startpoint sampling for v2.Problem supporting all new prior distributions

Related to #374

@dweindl dweindl mentioned this pull request Apr 25, 2025
5 tasks
@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 57.14286% with 12 lines in your changes missing coverage. Please review.

Project coverage is 74.11%. Comparing base (b73e0a9) to head (ffd670c).

Files with missing lines Patch % Lines
petab/v2/core.py 42.85% 7 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #380      +/-   ##
===========================================
- Coverage    74.11%   74.11%   -0.01%     
===========================================
  Files           58       58              
  Lines         6360     6386      +26     
  Branches      1091     1098       +7     
===========================================
+ Hits          4714     4733      +19     
- Misses        1240     1241       +1     
- Partials       406      412       +6     

☔ View full report in Codecov by Sentry.
📢 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.

* Add `Parameter.prior_dist`
* Update `v1.distributions.__all__`
* Implement startpoint sampling for `v2.Problem` supporting all new prior distributions
@dweindl dweindl marked this pull request as ready for review April 25, 2025 11:06
@dweindl dweindl requested a review from a team as a code owner April 25, 2025 11:06
Copy link
Member

@dilpath dilpath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

return {
p.id: p.prior_dist
for p in self.parameter_table.parameters
if p.estimate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to drop non-estimated parameter priors, but then users might see unexpected posterior values. e.g. if they perform MAP then fix the parameters to those values and recompute, there will be an undocumented change in the posterior value because their estimate column has changed.
So perhaps priors + fixed parameters should be an error or warning?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I am not sure. It's effectively a different problem then (kind of like changing your prior to a Dirac delta?), so that a change in the posterior should be expected, isn't it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, a change can be expected, but then priors should be treated as an error since they are dropped, or?

Copy link
Member Author

@dweindl dweindl Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but then priors should be treated as an error since they are dropped, or?

I'd say it shouldn't be an error.

It's the same as with bounds for fixed parameters.

Those are explicitly allowed to be specified with estimate=false (specs):

  • lowerBound [NUMERIC]

    Lower bound of the parameter used for estimation. Optional, if estimate==false.

  • upperBound [NUMERIC]

    Upper bound of the parameter used for estimation. Optional, if estimate==false.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, same issue there, but the worst thing that happens there is that the user looks into their parameter estimates and sees that they can't find the parameter that they thought they estimated. In the priors case, it would be difficult to notice the mistake.

But you're right, and since it's nice to toggle parameters on or off without having to change other columns, fine to not have an error. As you like, but a warning/info/debug for unused priors could still be nice

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could be part of some (yet to be implemented) warning mode for validation then, but I'd still find it somewhat confusing to treat priors different than bounds in that situation. Maybe that's something to leave to the parameter estimation tools.

dweindl and others added 3 commits April 25, 2025 13:38
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
@dweindl dweindl merged commit 84fbdba into PEtab-dev:develop Apr 28, 2025
7 checks passed
@dweindl dweindl deleted the v2_startpoints branch April 28, 2025 09:17
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.

3 participants