[R] Zero truncated Poisson distribution & R2WinBUGS
Ben Bolker
bbolker at gmail.com
Tue Nov 16 00:54:55 CET 2010
julien martin <julemartin0320 <at> gmail.com> writes:
> (2) The second part of the script calls WinBUGS and run the binomial
> mixture models on the count data. In this case the count matrix y was
> converted to a vector C1 before being passed over to BUGS
> Any idea how to create a zero truncated Poisson for parameter lam1
> (i.e., parameter lambda of the Poisson distribution)
>
> Thank you for your help.
>
> lam1~dgamma(.01,.01)
> # Likelihood
> # Biological model for true abundance
> for (i in 1:R) { # Loops over R sites
> N1[i] ~ dpois(lambda1[i])
> lambda1[i] <- lam1
> }
Do you mean that N1[i] should be drawn from a zero-truncated
Poisson rather than a Poisson distribution in the snippet above?
If so, I think you want to search for the "ones trick" or the
"zeros trick" in WinBUGS documentation, e.g.
http://mathstat.helsinki.fi/openbugs/data/Docu/Tricks.html
More information about the R-help
mailing list