Stefano Conti - 2013-10-03

Dear JAGSers,

I've been trying to fit sparse count data using a Negative Binomial distribution for some time, and and seem to be hitting the same buffer with the 'dnegbin' function seemingly not digesting r=0 parameter specifications even in JAGS 3.4.0 (despite release notes to the contrary).

Below you'll find a trivial Negative Binomial model with a Uniform prior on its probability parameter in support of my experience. Swapping the number of successes with that of failures, so that the latter would be a positive count, would instead lead to no crash.

Additionally note that restricting the range of the 'prob' parameter to exclude either 0 or 1 does not help. Besides, I invariably get a fatal crash ("multi-argument returns are not permitted") when I attempt running the simulation through R via the 'jags' package. Using the 'R2jags' alternative would instead not give any problem.

I'd greatly appreciate any help you may have on this. With many thanks in advance for your time, all the best,

--
Dr Stefano Conti
Public health England

== Start of Negative Binomial model template ==
model
{
obs[1] ~ dnegbin(prob, obs[2])
prob ~ dunif(0, 1)
}
== End of Negative Binomial model template ==

== Start of data list ==
$obs
Success Failure
10 0
== End of data list ==

== Start of initialisers list ==
$inits1
$inits1$prob
[1] 0.5
== End of initialisers list ==