bridgesampling
bridgesampling copied to clipboard
Adds support for CmdStanFit objects. #27
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.
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.
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 forcores > 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 toCmdStanFit
method as exists forstanfit
methods (lines 202 to 205). - [ ] Can you confirm if the
CmdStanFit
method works forcores > 1
on non-Windows OS?
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.