Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#29 The error message "Inconsistent arguments for logDensity in distribution dsum" might not be sufficient to diagnoze the problem with the model

v1.0_(example)
closed
nobody
None
1
2014-08-17
2013-05-27
Adam Ryczkowski
No

I try my luck with dsum to model an observed variable that is known to be a sum of two latent variables (see http://sourceforge.net/p/mcmc-jags/feature-requests/5 on my failures on more straightforward efforts with input[2] ~ dnorm(s1+s2,25)).

I came up with the following model:

var
   input[2], #Input: Log hazard ratio wynikający z badania
   tau,
   s1,
   s2
model{
input[1] ~ dnorm(i1,50)
input[2] ~ dsum(i1,i2)
i1 ~ dnorm(0,tau)
i2 ~ dnorm(0,tau)
tau~dgamma(0.001,0.001)
}

Upon compilation I've got

RUNTIME ERROR:
Inconsistent arguments for logDensity in distribution dsum

error. It can well be my failure with understanding of how to use the dsum distribution (it's the first time I try to use it), but I can't find any working examples on the net. But the error message is insuficient to diagnose the problem.

Discussion

  • Martyn Plummer
    Martyn Plummer
    2013-05-30

    How about this:

    Error in node input[2]
    Observed node inconsistent with unobserved parents at initialization.
    Try setting appropriate initial values.
    
     


Anonymous


Cancel   Add attachments