Closed joezuntz closed 5 years ago
Happy to take a PR for this if you'd like to contribute. Otherwise, I'll try and implement this when I get around to resolving the other open issues in ~a week or so.
Alright, it's...uh...a little past a week, but I've now spent a good amount of time looking at this. I originally thought this would be straightforward, similar to its implementation in emcee
. Essentially, I just planned to check whether the loglikelihood
returns more than 1 output, partition them into logl
and logl_extra
, and continue on as normal (saving logl_extra
as appropriate).
Turns out there are several structural reasons why this is difficult to implement in dynesty
, in the same vein as the difficulties trying to implement a previous feature request. The two biggest reasons are:
Most of these problems just comes down to me having not properly structured the code to enable these types of add-ons. Tackling this without adding a billion safety checks would probably require significant rewriting of the internals, so I'm just going to put this on hold for now.
I know that this is disappointing (I am currently working on a problem where keeping track of additional parameters returned from the loglikelihood
would be extremely useful), and apologize both for the delay in getting back to you and failing to properly structure the code to enable this. It's a good lesson I hope to carry forward to future projects.
Hi Josh,
Many thanks for considering this and letting me know, and sorry I never got around to attempting it myself, though it sounds like this would be pretty hard in this case.
Cheers, Joe
It's extremely useful to be able to record and output a set of derived parameters for each point in parameter space, along with the sample point itself. We often want to plot contours of these derived parameters.
Emcee calls this feature "blobs", and enables it by checking how many outputs the loglikelihood function returns - if it returns two objects the second is assumed to be some generic output to be returned to the user along with the sample.
I'd be happy to provide a PR for this if you would consider it.
Many thanks, Joe