Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Mar 16 18:15:18 CET 2000

> To: Martyn Plummer <plummer at iarc.fr>
> Cc: John Logsdon <j.logsdon at lancaster.ac.uk>, r-help at stat.math.ethz.ch
> Subject: Re: [R] MCMC
> From: Douglas Bates <bates at stat.wisc.edu>
> Date: 16 Mar 2000 10:17:29 -0600
> Martyn Plummer <plummer at iarc.fr> writes:
> > On 16-Mar-00 John Logsdon wrote:
> > > Does anyone know of any R coding/functions for MCMC approaches?  I am
> > > currently using BUGS but I wonder if the bazaar has produced anything?  I
> > > think I am pushing BUGS to it's limit and possibly past it at the moment.
> > I don't think you will find anything as polished as BUGS, but the
> > components are available for you to write your own custom MCMC program.
> > You have to do a lot of work by hand that is normally done by BUGS, e.g.
> > specifying full conditionals, writing the functions for logical
> > nodes, recognizing conjugate distributions, tuning the Gibbs sampler, etc.
> > * libnmath contained within R provides plenty of functions for simulating
> >   random variables from commonly used distributions.  Brian Ripley has
> >   kindly modified this so that it can be built separately. Using this you
> >   can handle conjugate distributions.

(Work in progress, really. By 1.1 it should be easy to build this.)

> > * Wally Gilks has made publically available software for doing Adaptive
> >   Rejection Metropolis sampling which can be downloaded from the MRC-BSU
> >   web site.  Using this you can handle more difficult cases:
> >   http://www.mrc-bsu.cam.ac.uk/Software/arsregister.shtml
> >   Some tuning is required for optimal performance.
> > I have used this approach on a small problem, and have an increased
> > appreciation of BUGS for having done so.
> I don't know of any R code or packages presently available for MCMC.
> However, it would be a very interesting project to design such code,
> either for R or for omegahat.  

I remember raising that at DCS99 in Vienna. I think as a generic
idea (and even BUGS after several years has quite serious limitations)
it would be very ambitious. Smaller areas may be more amenable. We are
currently designing some code for GLMM-type models, and at one
point Jonathan Myles had some, I believe.

> The concept of a function closure in R
> could be quite helpful.  I think Ross Ihaka and/or Robert Gentleman
> wrote a paper once on how a Bayesian model would naturally be
> expressed as a function closure.  
> It took me a long time to understand what a function closure is and
> why it would be useful (my thanks for Robert Gentleman and Duncan
> Temple Lang for explaining it to me - repeatedly) but for applications
> like this it is definitely worth the time to learn about it.

I worry about computational efficiency here. R code with extensive
use of closures currently seems to slow.

I think we need to be careful with terminology. S-news gets a posting
every few months asking for implementations of the EM algorithm (which
is not an algorithm but an idea).  Similarly, MCMC is an idea, and even
in its earlier incarnations (my work on simulating marked point
processes for one, Langevin methods for another) went way beyond what
one finds in the books that are getting written now.  MCMC != BUGS, and
different subsets might be appropriate for R packages.

BTW, package spatial does contain some MCMC code written 25 years ago.

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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list