Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy switching between likelihood and posterior #1325

Open
arrjon opened this issue Mar 11, 2024 · 2 comments
Open

Easy switching between likelihood and posterior #1325

arrjon opened this issue Mar 11, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@arrjon
Copy link
Contributor

arrjon commented Mar 11, 2024

Feature description
Depending on the context, the pypesto objective can be a likelihood or a posterior. It would be nice to have easy acess to both, e.g. if I have defined the objective as the posterior and added x_priors to get the likelihood by something like self.problem.objective(x, priors=False).

Motivation/Application
Depending on whether one is using optimisation or sampling, either the likelihood, the posterior or both might be requiered. Beeing able to quickly switch between them would make code more readable, see for instance #1324.

The old issue #414 might be related to this.

@arrjon arrjon added the enhancement New feature or request label Mar 11, 2024
@vwiela
Copy link
Contributor

vwiela commented Mar 12, 2024

Agreed, one could maybe add a flag or method to the objective, to distinguish different kind of objectives.

Additionally, it seems like that naming and comments in some example notebooks needs some revision then as well.

@dweindl
Copy link
Member

dweindl commented Mar 12, 2024

Independent of switching between types, it would be great to know what type of objective one is dealing with. Then things like profile likelihoods should refuse to work with random objective functions.

Agreed, one could maybe add a flag or method to the objective, to distinguish different kind of objectives.

👍

Either some flag, or something like PosteriorObjective(ObjectiveBase) that has a .getNegLogLikelihood[Objective]().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants