pyPESTO icon indicating copy to clipboard operation
pyPESTO copied to clipboard

Separate likelihood and prior

Open yannikschaelte opened this issue 4 years ago • 4 comments

Currently, the problem.objective contains per default the posterior. This is what is needed for optimization, however for sampling having likelihood and prior separated would be preferable, in order not to evaluate things twice, and since it is otherwise impossible to verify whether the objective prior is the problem prior. One way of accomplishing this would be to make the problem._objective private and add functions problem.get_neglogpost(), problem.get_neglogprior(), problem.get_negloglikelihood(). Opinions?

yannikschaelte avatar Jun 19 '20 19:06 yannikschaelte

Whats the reason to implement get_neglogpost and get_neglogprior, get_negloglikelihood as problem method? I find it more plausible to have them as method of objective.

FFroehlich avatar Jun 22 '20 14:06 FFroehlich

One could add said functionality to a class NegLogPosterior (which should exist already), which should basically hold a prior and a likelihood, in addition to __call__.

yannikschaelte avatar Jun 22 '20 14:06 yannikschaelte

One could add said functionality to a class NegLogPosterior (which should exist already), which should basically hold a prior and a likelihood, in addition to __call__.

Sounds good!

FFroehlich avatar Jun 22 '20 14:06 FFroehlich

too many old issues ... this one's related to #594

yannikschaelte avatar Mar 18 '21 08:03 yannikschaelte