Open arrjon opened 5 months ago
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.
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.
:+1:
Either some flag, or something like PosteriorObjective(ObjectiveBase)
that has a .getNegLogLikelihood[Objective]()
.
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 likeself.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.