Thursday, June 16, 2011

BRugs for Mac users

[You don't have to use BRugs any more; you can use JAGS instead. See this more recent post about JAGS.]

BRugs, as of now, can only be used with 32-bit Windows. Mac users must install and run through Windows (non-)emulators such as Wine. Here are some preliminary notes about how to install and use BRugs on a Mac.

Update: See also the more recent post regarding BRugs for Linux users.

Mac users: Please reply with additional tips, tricks, and info! (I am not a Mac user, so all of my info is 2nd hand.)

Installation:

In principle, the idea is to install 32-bit Windows R through Wine or WineBottler. In practice, I hear that this is not easy, and a search of the web shows some discussion that makes it seem like quite a process. Fortunately, the process has been nicely packaged by Jack Harris and posted by Seth Frey at http://enfascination.com/wiki/Weblog:Bayesian_data_analysis_on_a_Mac

Use:

Some of the Windows-friendly R commands are not interpreted properly on a Mac. Thanks to Chris Street for pointing out the following substitutions:

dev.copy2eps( file="blah" )
can be changed to
savePlot( filename="blah" , type="eps" )

At the command console,
help("command")
fails, but
??command
works.

Again, please reply (comment) with additional discussion.

6 comments:

  1. Another approach is to install it on a virtual windows machine using "Parallels" or "Fusion", which is fairly inexpensive software that runs Windows software at the same time as MacOS.

    ReplyDelete
  2. I also use Parallels when I need to use BRugs on my Mac. With all other methods, some keyboard shortcuts (and something else) don't work, thus writing/editing codes can sometimes become quite annoying.

    ReplyDelete
  3. I had a problem plotting: the graphs would have empty labels. Setting the plotting device to be X11 (i.e., replacing windows() with X11()) and setting par(family="mono") seem to solve the problem. Maybe this is a strange problem because my fonts are mixed up, but I'm posting it in case other people have these problems.

    ReplyDelete
  4. I'm not a Mac user (I use Linux) but have had good experience with a winBUGS/openBUGS alternative called "JAGS" (Just Another Gibbs Sampler) which runs fine on any platform and Mac OS X binaries should be available. It also has an associated R package called "rjags". As JAGS is based on the BUGS language, moving from BUGS to JAGS is very easy and all the examples in the book should work with minimal changes.

    ReplyDelete
  5. Unfortunately, the package from Jack Harris is no longer available. It looks like his advisor moved and the web site was taken down. Any chance you could get the file from him and post it here?

    ReplyDelete
  6. Dear Anonymous Oct. 22, 2011, 12:55 AM:

    The link to Jack Harris' package on Seth Frey's page has now been updated, so it should work again. Thanks for letting me know, and thanks again to Jack Harris.

    ReplyDelete