unobserved stochastic node as index

  • Stephanie Peacock


    I will first give the usual disclaimer that I am new to JAGS, and I apologize
    if the following question is silly.

    The model I am working with uses integral equations, in which the limits of
    integration are free parameters of interest. I am working with the numerical
    solution, so these limits of integration appear in the model as the upper
    and/or lower indices of counters in sums. I am encountering the error:

    Error in jags.model(model, data, n.chain = n.chains, n.adapt = n.adapt) : 
    Compilation error on line 6.
    Cannot evaluate upper index of counter i

    Is it true that you cannot have unobserved stochastic nodes as upper limits on
    counters? If so, this seems like a major limitation to JAGS. Why is this?

    I have tried redefining deterministic nodes with the stochastic nodes as
    parents and using the deterministic node as the upper index, and encountered
    the same problem. Is there a workaround?

  • Martyn Plummer

    Martyn Plummer - 2011-07-18

    If you have a stochastic node as the upper limit of a counter then you are
    allowing the dimension of the model to change. Such models is beyond the scope
    of JAGS as they require special techniques (reversible jump).

    Dave Lunn has done some work with reversible jump in WinBUGS. See David J.
    Lunn, Nicky Best, John C. Whittaker. Generic reversible jump MCMC using
    graphical models, Statistics and Computing , vol. 19, no. 4, pp. 395-408,


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks