13
$\begingroup$

I am following a course on Bayesian statistics using BUGS and R. Now, I already know BUGS, it's great but I am not really fond of using a separate program rather than just R.

I have read that there are a lot of new Bayesian packages in R. Is there a list or reference on which packages there are for Bayesian statistics and what these do? And, is there an R package alternative for the flexibility of BUGS?

$\endgroup$

5 Answers 5

8
$\begingroup$

You can take a look at the MCMCglmm package that comes with very nice vignettes. There's a also a bayesglm() function for fitting Bayesian generalized linear models in the arm package, by Andrew Gelman. I've also heard of a future release blmer/bglmer functions for hierarchical modeling in the same package.

$\endgroup$
1
  • 2
    $\begingroup$ In the package arm there is the fucntion bugs, which allows you to call bugs from R. That's what I use in my reasearch. In the Gelman's blog there is an example of caling winbugs by R. $\endgroup$ Commented Jun 6, 2011 at 15:32
9
$\begingroup$

Bayesian CRAN task view

$\endgroup$
6
$\begingroup$

A few people I know have been using JAGS. The JAGS syntax is similar to BUGS.

$\endgroup$
1
  • $\begingroup$ (+1 but I think the OP is after some pure R solution.) It works great with the rjags package, but we still need to specify our model in BUGS syntax in an external file. $\endgroup$
    – chl
    Commented Jun 6, 2011 at 10:59
5
$\begingroup$

Second the Bayesian task view. I'd just add a vote for MCMCpack, a mature package which offers a variety of models. For the most part it's pretty well-documented too.

$\endgroup$
0
$\begingroup$

Performance is the main reason people use WinBUGS / OpenBUGS /JAGS vs. packages like MCMglmm. It is very hard not practical to write an efficient Gibbs sampler in native R. There are packages that let you run BUGS models from an R script, notably RBUGS and BUGSParallel.

$\endgroup$
3
  • 1
    $\begingroup$ MCMCglamm is a bad example because "[a]ll simulation is done in C/ C++ using the CSparse library for sparse linear systems" (see abstract). $\endgroup$ Commented Jun 6, 2011 at 13:03
  • 1
    $\begingroup$ -1; see @Bernd. Most mature packages use compiled code. The main reason is actually that BUGS et al are more flexible in that they can fit more models. While this may lead to more efficient computation since an R package - even with compiled code - has to be more general, it may not. $\endgroup$
    – JMS
    Commented Jun 6, 2011 at 15:00
  • 2
    $\begingroup$ MCMCpack uses compiled C/C++ code, optimized for the task at hand, so it's actually faster than doing something in a generalized package like JAGS (for a particular task). $\endgroup$
    – Wayne
    Commented Mar 20, 2012 at 20:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.