Re: [R] dgamma in WinBUGS and JAGS (rjags)

From: Ben Bolker <>
Date: Thu, 26 Jun 2008 01:20:36 +0000 (UTC)

Seyed Reza Jafarzadeh <srjafarzadeh <at>> writes:

> Hello,
> In WinBUGS 1.4 manual
> (, the gamma
> density is presented as dgamma(r,mu) where r and mu are the shape and
> rate parameters, respectively. In JAGS (rjags) manual version 1.0.2,
> May 9, 2008 (,
> on page 26 the gamma density is presented as dgamma(mu,r) instead of
> dgamma(r,mu). Since JAGS uses the BUGS language, I was wondering if
> this is a typo or it is in fact different from WinBUGS.

  I don't know, but I would suggest (1) trying a couple of little simulations to try it out for yourself -- for example with the following BUGS code

mu <- 1
r <- 1
x ~ dgamma(mu,r)

 and see what the distribution looks like.

and (2) e-mailing Martyn Plummer, the author (since it seems likely that this is a documentation bug, he probably would like to hear from you)

  Ben Bolker mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 26 Jun 2008 - 01:27:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 03 Jul 2008 - 10:31:23 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive