bridgesampling icon indicating copy to clipboard operation
bridgesampling copied to clipboard

Adds support for CmdStanFit objects. #27

Open crsh opened this issue 1 year ago • 4 comments

This is a first pass at implementing support for CmdStanFit-objects (#27, @bnicenboim, @maxbiostat). While this works, it is quite inefficient compared to the methods for stanfit-objects. This is because the cmdstanr-method to unconstrain parameters is very slow compared to the rstan-methods on my machine. I have opened an issue and the cmdstanr-repository to see if this can be improved. But maybe you already have thoughts on this; any feedback would be welcome.

crsh avatar Feb 12 '24 19:02 crsh

Stellar stuff, thanks! Let's hope the cmdstanr folks can come to the rescue so we can make this efficient. I'm a bit swamped right now but I can throw together a few tests using my own stuff to see just how much slower your solution is and if I have any thoughts on how to make it faster.

Maybe @andrjohns has thoughts.

maxbiostat avatar Feb 12 '24 21:02 maxbiostat

I apologise for the long delay in getting to this, but it took me until today to figure out how to use init_model_methods() on windows (solution here).

I have now checked this and it looks really good. Before accepting this just a few things that would be good to check/change.

  • [ ] You changed the stanfit method and the branch for cores > 1 seems broken. Code on lines 223 to 228 seems to be partically repeated on lines 240 to 246. Please fix.
  • [ ] For the CmdStanFit method, cores > 1 does not work on Windows. Please add same check to CmdStanFit method as exists for stanfit methods (lines 202 to 205).
  • [ ] Can you confirm if the CmdStanFit method works for cores > 1 on non-Windows OS?

singmann avatar Apr 06 '24 16:04 singmann

Thanks, @singmann. I have implemented the changes you requested and confirmed that cores > 1 works on Ubuntu.

The upside of my delayed response is that the Stan team has now resolved the issue that was causing the slow unconstraining of parameters.

crsh avatar May 16 '24 07:05 crsh