[R-sig-ME] Documentation for the glm module in jags/rjags?

Martyn Plummer plummerM at iarc.fr
Thu Mar 31 22:00:58 CEST 2011


I'm sorry, the whole project is somewhat under-documented at the moment,
but in addition the glm module is a work in progress.

>From a user point of view, it should be fairly transparent. Using rjags,
you type

R> loadModule("glm")

before calling jags.model().  If your model contains a GLM then JAGS
should recognize it and provide samplers that do block updating of the
parameters in the linear predictor.

To see if it is working, call list.samplers(m) where m is the JAGS model
object. The return value is a named list: the names correspond to the
sampling method, and the values are the names of the nodes that are
updated by that sampler. Samplers have names prefixed by the module
name, so if you have any entries in the sampler list called "glm::*"
then it is working.

For some examples, you can download the classic bugs examples from
http://sourceforge.net/projects/mcmc-jags/files/Examples/2.x/

The subdirectories "epil", "oxford", and "seeds" (in vol1) contain R
scripts that you can run using rjags, or scripts with the name test*.cmd
that you can run using jags in batch mode.

Under the hood, most of the samplers use data augmentation to reduce the
model from a GLM to an LM, then the block updating relies on Tim Davis's
libraries for sparse matrix algebra (Very much following your lead here
but with a much more basic use of the sparse matrix algebra).  Variance
parameters for the random effects are still a problem and can show poor
mixing even when everything else is working properly.  As I said, it is
a work in progress.

I hope this helps.
Martyn 

On Wed, 2011-03-30 at 13:11 -0500, Douglas Bates wrote:
> In reading about the glm module in JAGS it seems that it is suitable
> for sampling from the posterior distribution of the parameters in a
> generalized linear mixed model.  However, I haven't been able to find
> documentation on how to use this module in particular.  Section 5.6 of
> the JAGS User Manual for version 2.2.0 hints at abilities but doesn't
> really expand on how to use them.
> 
> Can anyone point me to further documentation or examples?


-----------------------------------------------------------------------
This message and its attachments are strictly confidenti...{{dropped:8}}




More information about the R-sig-mixed-models mailing list