What is faster, Winbugs or Openbugs?

Sandra McBride writes:

My current model (in Winbugs) runs very slowly on my very slow laptop, so I am getting a new desktop. Here are some questions in the hopes of speeding up my model:

Is Winbugs or Openbugs multithreaded? (Then I’d buy a quad core rather than a duo core)

When using from within R, is Openbugs faster than Winbugs in general?

My reply: I don’t know, but I’ve heard that JAGS is the fastest. I’m not sure if R2WinBUGS is set up to run JAGS, but if not, it could be done (right, Yu-Sung)? Also, I would think that in a parallelized implementation of R, it would be straightforward for R2WinBUGS to run 4 chains and send one to each of 4 processors; however, I don’t know that this has actually been implemented.

In any case, I’m hoping that not too far in the future we’ll have some a version of Bugs that is much faster, at least for the sorts of hierarchical regression models that Bugs currently chokes on.

10 thoughts on “What is faster, Winbugs or Openbugs?

  1. Yes, I have sent the code of R2jags to the R2WinBUGS author. R2WinBUGS shall be able to do jags in the next release. In the meantimes, you are welcome to use R2jags to run JAGS via R. I have documented the way to do this here.

  2. I was wondering whether the R2WinBugs package in R can have over-relaxation factored in. I know that BRugs had the over relaxation option but then I seem not to find it anymore on the Cran (R) package list. This is probably because R2WinBugs seems to have "swallowed up" the competition (just a though!). But it would be good for R2WinBugs to have the over relaxation option in the next release of R – that is if its feasible.

  3. You could do the parallel thing right now… if you've fixed the WinBUGS issue preventing it from running on multiple machines in the same directory (unfortunately, details are "commercial", sorry!).

  4. Luwis, BRugs was moved from CRAN to the CRANextras repository. You can install it into R for windows from the "packages" menu if you select the CRANextras repository first.

    Yu-Sung, your instructions for rjags are slightly out of date as it no longer depends on SWinRegistry.

  5. To Martyn,

    Thanks for letting us know that. I have corrected it.

    One other thing. I have met serveral friends in this year's Political Methodolgoy conference. They were asking if there is going to be a rjags package available for Mac OS.

  6. rjags installs fine for me (you need the OS X developer packages in your system, though.)

    <pre> install.packages("rjags",type="source") </pre>

    Also, you could easily cook up a version of jags2 in R2jags to use the snow package and parallelize computation.

    In my 2.2ghz Core 2 Duo Macbook, using the example from the helpfile and jags2

    <pre> user system elapsed
    21.812 21.340 22.083</pre>

    Using a parallelized version with the snow package

    <pre>
    user system elapsed
    0.462 0.041 16.686
    </pre>

    About 30% faster. I don't know how fast winbugs/openbugs perform the same problem.

    <pre>(jags2(data=jags.data, inits=jags.inits, jags.params,n.iter=500000, n.thin=100, model.file=model.file)))</pre>

  7. Multithreaded wont get you better performance on a quad vs dual core. The code has to be written to take specific advantage of those multiple cores. Most code, today, isnt. The machines are just faster by the raw processing power that the newer and multiple core processors offer.

    If you want REAL multitasking speed then get a dual CPU (not dual core). Two or more physical CPUs on one motherboard. My dual CPU (intel pentium iii 833mhz

  8. Before he was cruelly stolen away to work on something else, Andrew Thomas was starting to work on parallelisation of OpenBUGS. As with many of these things, what we're short of is the man power.

  9. This was written a while back…I was wondering if what Andrew mentioned in the post about parallel implementation of R so that R2WinBUGS can run 4 chains and send one to each of processors has been implemented.

    Any help/references would be much appreicated..Thanks!!

Comments are closed.