44

I am about to try out a BUGS style environment for estimating Bayesian models. Are there any important advantages to consider in choosing between OpenBugs or JAGS? Is one likely to replace the other in the foreseeable future?

I will be using the chosen Gibbs Sampler with R. I don't have a specific application yet, but rather I am deciding which to intall and learn.

Stat-R
  • 661
  • 6
  • 17
DanB
  • 898
  • 8
  • 13

4 Answers4

35

BUGS/OpenBugs has a peculiar build system which made compiling the code difficult to impossible on some systems — such as Linux (and IIRC OS X) where people had to resort to Windows emulation etc.

Jags, on the other hand, is a completely new project written with standard GNU tools and hence portable to just about anywhere — and therefore usable anywhere.

So in short, if your system is Windows then you do have a choice, and a potential cost of being stuck to Bugs if you ever move. If you are not on Windows, then Jags is likely to be the better choice.

vkehayas
  • 701
  • 5
  • 13
Dirk Eddelbuettel
  • 8,362
  • 2
  • 28
  • 43
  • 6
    Under Linux Window emulation is not necessary, the shared library can be directly used. Only the GUI is not working this way, but that shouldn't be a problem for DanB as they want to invoke it from R. – GaBorgulya Apr 05 '11 at 19:36
  • 1
    @GaBorgulya Despite that, if I was choosing between two tools, I'd choose the tool that fully worked on my chosen system. – Fomite Aug 23 '12 at 04:24
  • 1
    At present, the BRugs package is not supported on 64 Bit Linux, as stated in the documentation, and this can result in problems such as the one that I faced [C fails to compile](http://stackoverflow.com/q/12078117/199217) when trying to figure out how to use plot.coda with the mcmc.list output from rjags in two questions [on this site](http://stackoverflow.com/q/12078152/199217) and [SO](http://stackoverflow.com/q/12078152/199217) that remain unanswered. – David LeBauer Sep 07 '12 at 13:54
14

For those who find this question down the road: there's now also Stan. Stan may one day replace OpenBUGS and JAGS, but it does not yet support all the analyses that these other packages do.

Jack Tanner
  • 4,552
  • 3
  • 27
  • 39
  • 4
    Almost a year later, I thought I'd comment on this. The developers seem dedicated, and the things that they plan on adding to it (variational inference!) all point to Stan inevitably replacing OpenBUGS and JAGS. That being said, I don't trust it at the moment and as of now would only use it when JAGS is not an option. It seems to require *more* tweaking to get sensible results in complicated problems, rather than less. Stan doesn't use Gibbs sampling at all, and for problems where I know Gibbs will work I can't justify using it. I think in the future these issues will be resolved, though. – guy Oct 30 '13 at 17:39
  • 1
    @MattTagg I don't think my assessment has changed, but I'm not an expert. I've used it a lot and gotten better with it, but I haven't kept up with all of their developments. There are a bunch of models where I wish I could mix NUTS with simple Gibbs sampling updates (a mix of `JAGS` and `STAN` essentially), but that doesn't seem to be on the horizon any time soon for `STAN` although it is certainly possible to do. – guy Nov 16 '14 at 20:58
  • 1
    cool, good to know thanks. about to start working through the new edition of "Doing Bayesian Data Analysis" with examples updated in JAGS and STAN. – cavalcade Nov 25 '14 at 00:25
  • 1
    Checking back to see the most current comparison of JAGS and STAN. Which one is better now and which is most likely to be better in the future? – itpetersen May 14 '16 at 22:54
  • A question has been posted asking for help to translate a bugs model to stan: https://stackoverflow.com/questions/53809468/translating-winbugs-models-to-rstan. - any help would be much appreciated. – Krantz Jan 03 '19 at 13:26
5

I recommend you jags over openbugs for speed reasons. I've tried both on a Linux system, and jags is way faster.

mra
  • 51
  • 1
  • 1
5

I find jags works more smoothly in Linux, and is easier to setup, but it does not presently support the spatial analyses that GeoBUGS supports. So, I use OpenBUGS.

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
astaines
  • 381
  • 2
  • 8