Installation of WinBUGS

Installation of WinBUGS on Mac Lion

Below you can find an instruction on how to install WinBUGS on Mac Lion and on how to use R2WinBUGS (R package that enables you to run WinBUGS from R). This installation involves Wine – a compatibility program for running Windows programs on Macs. Before you start, make sure that you have X11 installed.

  1. Install Wine in your applications folder.
  2. Go to http://www.mrc-bsu.cam.ac.uk/software/bugs/the-bugs-project-winbugs/
    On this website, you can download WinBUGS. You should select “zipped version of the whole file structure” (2nd bullet point under “Quick start”)
  3. Unzip the WinBUGS folder and put it in your application folder.
  4. Open Wine.app in your applications folder (installed in step 1). Go to the WinBUGS folder and click on WinBUGS.exe.
  5. Go again to http://www.mrc-bsu.cam.ac.uk/software/bugs/the-bugs-project-winbugs/ Download the immortality key and safe it as a text file.
  6. Open WinBUGS through Wine as described in step 4. Open the text file containing the immortality key in WinBUGS. Click on Tools → Decode → Decode all.
  7. Go again to http://www.mrc-bsu.cam.ac.uk/software/bugs/the-bugs-project-winbugs/ Download the patch and safe it as a text file.
  8. Open WinBUGS through Wine as described in step 4. Open the text file containing the patch in WinBUGS. Click on Tools → Decode → Decode all. This should complete your installation of WinBUGS. You should now be able to run WinBUGS.
  9. If you want to run WinBUGS from R using the package R2WinBUGS, you have change bugsdir – the directory where WinBUGS is installed – and you have to provide the paths to wine and winepath binary files in the bugs() call (see example below).

samples = bugs(data, inits, parameters, model.file, n.chains, n.iter, n.burnin, n.thin, 
bugs.directory = "/Applications/WinBUGS14",
WINE = "/Applications/Wine.app/Contents/Resources/Java/bin/wine",
WINEPATH = "/Applications/Wine.app/Contents/Resources/Java/bin/winepath")

Comments