unexpected values from dic.samples()

Help
2011-03-21
2012-09-01
  • Tim Handley
    Tim Handley
    2011-03-21

    I'm running JAGS (2.2.0 x64, Win7) from R (2.12.2) via Rjags, and I'm
    interested in the mode of the deviance distribution as a rough way to compare
    my JAGS model with some similar maximum-likelihood models. According to the
    help for dic.samples(), the dic object which is produced by dic.samples() has
    an element called "deviance" which is "a list of mcarray objects, one for each
    observed stochastic node, containing samples of the deviance." Thus, I was
    expecting {dic.object}$deviance_ to be an array of Nsamples numbers, giving
    samples of the deviance of node i. However, it turns out that all of the
    elements of {dic.object}$deviance have length 1. Does this mean that
    {dic.object}$deviance_ gives the mean deviance at node i across all samples?
    Is there some way of actually looking at the sampled deviance values so that I
    could find the mode of the total deviance?__

     
  • Martyn Plummer
    Martyn Plummer
    2011-03-23

    I changed the format of dic.samples, but forgot to update the documentation. A
    new version of rjags has been pushed to CRAN.

    Originally I stored individual samples for individual nodes, but in a model
    with 1000s of observations and 1000s of iterations, this uses up a lot of
    memory. The new dic.samples() just records the mean contribution to the
    deviance and to pD for each observed node.

     
  • Tim Handley
    Tim Handley
    2011-03-23

    Thanks for the info. And thanks for sharing your work.

     
  • Martyn Plummer
    Martyn Plummer
    2011-03-23

    You're welcome. It might even work properly one day.