R is an excellent tool for a wide variety of statistical analyses, it’s not the only game in town. Practitioners of Bayesian statistics have a few other tools that complement
R nicely. One case where
R originally lagged was in offering a general-purpose MCMC sampler. That situation has largely changed, but there are still cases where you might want to look outside of the
R toolbox. In particular, certain Bayesian stats books are written with the assumption that exercises and examples can be executed in
WinBUGS. While there is (just) another Gibbs sampler that runs natively on OSX and linux,
JAGS can’t read
Read on to see how I got
WinBUGS running on my PowerPC OSX laptop connect to a linux server.
A disclaimer: this worked for me without causing anything to explode (yet). I’m not responsible for whatever you happen to break by following these instructions. I’ll try to help if you get stuck, though.
The goal is to run
WinBUGS. Let’s cover some easy ways to do that.
- Use Windows. Download
WinBUGS. Get the immortality key and follow its instructions. Problem solved.
- If you have an Intel Mac, I would suggest that you just install
Wineon your local machine using MacPorts. Instructions to do that can be found here.
- If you are running Linux, use your package manager (
apt-geton Debian-based systems,
yumon Redhat-based systems, etc.) to install
OpenBUGS. If your package repositories don’t include
OpenBUGS, you can follow the instructions below to download and install
- The brave amongst you may wish to try installing
Winelocally on a PPC Mac. The Darwine project aims to make that possible. See this post to get started with Darwine. Note that the only version of Darwine for PPC Macs is quite old.
Assuming none of those options works for you, and you have access to a Linux server and a PPC Mac, you can follow the steps below to replicate my setup.
First we grab
OpenBUGS for our linux server:
mkdir src; cd src
Next, we download and install Wine (Wine Is Not an Emulator). This lets us run many Windows programs on Linux.
tar -xjvf wine-1.1.15.tar.bz2
make depend && make
make check # be sure you have an X11 session started
If everything worked correctly, you should see the
regedit program from windows open on your
X11 display. If you’re like me, though, you’re running OSX 10.4 on a PowerPC mac, and things didn’t work correctly. In my case, a normal looking Windows application opened, but there was no text in any of the menus or dialog boxes. Fonts seemed to be completely broken.
I took a couple of incorrect approaches that were probably harmless (like installing Microsoft CoreFonts), but eventually hit the solution. The OSX version of
X11 (at least in 10.4) does not use the
xrender library for displaying graphics. We can tell
Wine not to use this library either. I found this fix on an Ubuntu forum.
NB: If you are interested in installing extra fonts, I think the best way is probably with winetricks. You’re on your own for that step.
On the Linux server, open a text editor (I use
emacs). Create a new file called
no_xrender.reg. The name and extension on this file don’t matter, but that name reminds me what the file is for (turning off xrender) and how to open it (with the
Copy these lines into your file. Save it and close it.
Now, still on the Linux server, run
wine regedit no_xrender.reg
This will helpfully display absolutely no output whether it works or not. Cross your fingers and run
If that works you will see the
regedit application from Windows displayed with all of the proper text. If you’ve made it this far, then the
OpenBUGS version of
WinBUGS is just a few commands away.
And the big payoff: here’s a screenshot of one of Congdon’s examples from Bayesian Models for Categorical Data running on our remote linux server and being displayed on my trusty OSX 10.4 PPC laptop.