Skip to content
Prev 3411 / 20628 Next

lme4a, glmer and all that

[ Note to Martyn Plummer : this arises from a thread on the lme4
development list : I tried to use JAGS to solve a mixed-model related
problem, and the (non-)results seems fishy... I the took the liberty to
Cc you on this subject ]
 
Le jeudi 04 mars 2010 ? 12:06 -0600, Douglas Bates a ?crit :
I'm  currently trying to fit this in BUGS (JAGS, actually), and run in
strange difficulties : OpenBUGS (3.0.7) starts an endless loop while
adapting (first update after initialization), WinBUGS (1.4.3 with patch
in Wine) stops immediately with an unhelpful "Rejection 1" message. JAGS
(1.0.3) standalone seems to load model, load data, initializing well.
However, it stops at the adaptation step, stating "Error in node
alpha[<variable...>]. Current value is inconsistent with data". JAGS
called from R (through Martyn Plummer's rjags package) *crashes R*
(almost never seen that before...). I get this in ESS :

terminate called after throwing an instance of 'std::out_of_range'
  what():  Range: upper < lower bound in constructor

Process R abandon at Thu Mar  4 20:37:46 2010

The model, in which I find no "obvious" fault, is as follows :

model
{
    for (k in 1:nobs) {
        incidence[k] ~ dbin(p[k], size[k])
        logit(p[k]) <- alpha[herd[k]] + beta[period[k]] + gamma
    }
    gamma ~ dnorm(0.00000E+00, tau.gamma)
    tau.gamma <- pow(sigma.gamma, -2)
    sigma.gamma ~ dunif(0.00000E+00, 100)
    for (i in 1:nherd) {
        alpha[i] ~ dnorm(0.00000E+00, tau.alpha)
    }
    tau.alpha <- pow(sigma.alpha, -2)
    sigma.alpha ~ dunif(0.00000E+00, 100)
    for (j in 1:nperiod) {
        beta[j] ~ dnorm(0.00000E+00, 1.00000E-06)
    }
}

I tried to pass "reasonable" initial values through model.jags (rjags) :
                          inits=function() {
                            list(mu.alpha=rnorm(nlevels(cbpp$herd),0,1),
                                 mu.beta=rnorm(nlevels(cbpp
$period),0,1),
                                 gamma=rnorm(0,1))
... to no avail ! I even took the usual "unusual step" of looking at the
raw data and graphing them, with nothing suspicious jumping out of the
graphs...

I'm Cc'ing Martyn Plummer on this one, and am curious of his thoughts on
the subject...

HTH,

					Emmanuel Charpentier