A naive question from a non-statistician: I'm looking into running a Bayesian analysis of a model with high dimensionality. It's not a standard model (the likelihood requires a lot of code to implement), and I'm using a Linux machine. Was wondering if someone has any thoughts on what the advantages of OpenBugs are as opposed to just R (or should I be thinking WinBUGS under Wine?)? The AMCMC package in R promises to run MCMC's very rapidly. Have read that OpenBugs as a project was 'stalling' in 2007. Peter
Your request is too vague for us to be very helpful. However OpenBUGS runs without very frequent crashes only on some ix86 Linux machines -- and what those are is unclear and Uwe Ligges and I (working on BRugs) have been unable to find one recently. There are dozens of Bayesian MCMC packages on CRAN (look at its Bayesian task view). Most are less general and faster than BUGS. There is no 'AMCMC package in R'. There is at least one third-party effort of that name, not on CRAN and explicitly claiming The R function amcmc() will tend to run rather _slowly_, (his emphasis) so perhaps that is not the one you mean. On Sun, 22 Jun 2008, Peter Muhlberg wrote:> A naive question from a non-statistician: I'm looking into running a > Bayesian analysis of a model with high dimensionality. It's not a > standard model (the likelihood requires a lot of code to implement),'code' in what language? Note that MCMC does *not* require the likelihood to be calculated, and its renaissance in statistics ca 30 years ago was for models for which the likelihood is not even known completely.> and I'm using a Linux machine. Was wondering if someone > has any thoughts on what the advantages of OpenBugs are as > opposed to just R (or should I be thinking WinBUGS under Wine?)? The > AMCMC package in R promises to run MCMC's very rapidly. Have read > that OpenBugs as a project was 'stalling' in 2007. > > Peter-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
I've done some looking around in R and elsewhere to answer my question on the value of R vs. Bugs for MCMC. So, for anyone who is curious, here's what I think I've found: Bugs compiles its code, which should make it much faster than a pure R program. Packages such as AMCMC run MCMC in R, potentially with a user-defined C function for the density--which should make it comparable in speed to Bugs. The packages MCMCpack (MCMCmetrop1R function) and mcmc seem designed to run w/ a density function written in R. MCMCpack does have functions that use precompiled C code from the Scythe library (which looks nice), but I see no simple way to add a C density function. AMCMC and Bugs seem to use adaptive MCMC, but the other R packages don't appear to do so, which may mean another performance reduction. I see no way to insert my own proposal density in the R functions. JAG, a Java-based version of BUGS, apparently allows users to create their own samplers, which might be a way to insert a different proposal density. Details about how to install a sampler are not given in the manual, which, incidentally, is nevertheless much better than the Bugs manual. Also, the proposal density I'd want would probably treat different variables differently, so I may need Metropolis within Gibbs, not standard Gibbs sampling. Can't get a clear picture of what JAG's algorithm(s) are--the manual doesn't mention Metropolis. WinBugs and OpenBugs can't be made to run easily on Linux. It looks like WinBugs running under WINE might be the simplest viable configuration, though I don't know how well or quickly it runs under WINE or how much memory WINE ends up consuming. Given all this, it may be easiest for my purposes to try to tweak the AMCMC code to allow a different proposal density. Maybe. Peter
Hi Paul & Brian: Thanks for your replies! Paul: Thank you for the encouragement. You're right that I don't need the working examples or Doodle generator in WinBugs. I'm wondering what open-source components could easily substitute for the core Bugs functionality? Do you know if any of these work on a Linux computer? It does look like JAG would do the trick for a Linux system. My reservations, though, for my task are a few: JAG is java-based and I'm not sure how much of a performance hit there would be relative to C. The manual isn't very helpful for someone who wants to do something outside the box, in my case using my own proposal density and using different proposal densities for different parameters (probably w/ Metropolis in Gibbs). I'm not sure I can make JAG do the latter. I guess I could look through the code base (argh!)--but by then I might be better off learning enough about C and Scythe to write a point density function and using AMCMC. Brian: Thanks for the warning about instability in OpenBugs. As for me, I don't see any straightforward way to even install it on a Linux system. The Task View was very helpful (didn't realize there was a Bayesian one)--UMACS seems very promising, but will need to go through the documentation. I'm just looking for a general and flexible way to implement a Bayesian model that will run quickly. I'm guessing this is a need not a few people have. You are right that AMCMC is 3rd party. It runs slowly in R *relative to the user defining and passing the code a C function as opposed to R function for the point density.* Given that it's largely just an interface to C, I can't see how it could run slowly w/ a C density function. I misspoke: by 'likelihood' I meant point density estimate (p(y | theta, model)). Thanks all! Peter