I'm putting together a model in WinBUGS where I have data on the sum
of two Poissons. The parameters of the Poissons (say lambda and mu)
are parameters of the model, and posterior distributions of the
individual values that went into the sum are of interest. That is, a
simplified version of my model looks something like this:
model
{
lambda ~ dgamma(1,1)
mu ~ dgamma(1,1)
total <- lambda + mu
n ~ dpois(total)
p <- lambda/(lambda + mu)
m ~ dbin(p, n)
}
n would be observed data, all the other variables would be parameters
or logical nodes.
The problem comes when I specify data
list(n = 0)
because now the distribution of m is degenerate, and I get the error
message (when I try to generate inits or load inits) "Value of order
of binomial m must be greater than 0".
Is there a way to avoid this error? I need to keep those zero values
of n in the data, because they help to estimate lambda and mu. Can I
say something like
if (n > 0) m ~ dbin(p, n)
else m <- 0
?
Duncan Murdoch
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|