Dear Bugs people,
I want to include a random item of data on each cycle of the MCMC
simulation, which I'm doing using for example:
model{
M~dcat(w[])
r[M]~dbin(p,n)
p~dbeta(.5,.5)
}
#Data
list(r=c(10,11,12,13,14,15), n=21, w=c(.02,.02,.02,.02,.02,.9))
The problem is that although I want to simulate M, WinBUGS won't compile
the code unless I specify a data value for M. M is then fixed at that data
value & I don't get the effect I'm after.
I can get round this by including all the data and THEN randomly selecting
one of the p's. But I wondered if anyone can explain why this happens, and
if there's a neater way round the problem.
I'll post a summary of any replies to the list.
Thanks a lot,
Nicky
MRC Health Services Research Collaboration
Department of Social Medicine
University of Bristol
Canynge Hall
Whiteladies Road
Bristol BS8 2PR
Tel: +44 (0)117-331-3902
Fax: +44 (0)117-928-7365
Email: [log in to unmask]
-------------------------------------------------------------------
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
|