Dear All,
As an exercise to better understand the ones trick, I fitted some data to a
Poisson model using both the dpois() distribution and the "ones trick" (as
in the WinBUGS manual). The posterior distribution for the dpois() version
did not depend on the choice of two non-informative priors (dunif(0, 10) vs
gdamma(0.001, 0.001)). However, and to my surprise, the posterior did
depend on this choice when using the ones trick. The dpois() version and
the ones trick produced essentially the same result for dgamma(), but
different results for dunif().
Does anyone know why this might occur?
Two additional points:
1) A non-informative prior "should" give the result achieved using the
dpois() model (posterior for lambda should be ~dgamma(42, 35) -> mean=1.20,
sd=0.185).
2) The ones trick and the zeroes trick give the same result, with the
choice between the two "uninformative" priors influencing the posterior.
The WinBUGS code, data and output are given below...
dpois() version:
model
{
lambda ~ dunif(0, 10)
# lambda ~ dgamma(0.001, 0.001)
for (i in 1:35)
{
Offspring[i] ~ dpois(lambda)
}
}
data:
list(Offspring=c(0,0,0,0,0,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2, 3,3, 5,
0,0,0,0,0, 1,1,1,1, 2))
init:
list(lambda=1)
Both priors lead to:
node mean sd MC
error 2.5% median 97.5% start sample
lambda 1.199 0.1853 5.746E-4 0.865 1.19 1.588
1001 100000
ones trick version:
model
{
# lambda ~ dgamma(0.001, 0.001)
lambda ~ dunif(0, 10)
for (i in 1:35)
{
p[i] <- exp(-lambda + Offspring[i]*log(lambda) - logfact(Offspring[i]))
ones[i] <- 1
ones[i] ~ dbern(p[i])
}
}
same data:
list(Offspring=c(0,0,0,0,0,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2, 3,3, 5,
0,0,0,0,0, 1,1,1,1, 2))
init:
list(lambda=1)
The choice of prior influences the result:
prior: dgamma(0.001, 0.001)
node mean sd MC
error 2.5% median 97.5% start sample
lambda 1.199 0.1854 6.047E-4 0.8629 1.19 1.59
1001 100000
prior: dunif(0, 10)
node mean sd MC
error 2.5% median 97.5% start sample
lambda 1.228 0.1869 5.791E-4 0.8898 1.219 1.619
1001 100000
Thanks for any comments or ideas.
Cheers,
Mick
Michael McCarthy
Australian Research Centre for Urban Ecology
Royal Botanic Gardens Melbourne
c/o School of Botany
University of Melbourne
Parkville VIC 3010
Australia
ph: +61 3 8344 6856
fax: +61 3 9347 9123
web: www.nceas.ucsb.edu/~mccarthy
-------------------------------------------------------------------
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
|