Hi,
I am interested in assigning a discrete uniform distribution to a
variable x in BUGS. This is a variable for which I usually have data,
but for which the data are sometimes missing. The variable can take
integer values between 1 and 12.
My initial idea was to model my variable using the dcat function, e.g. with
for (j in 1:n ) {
p[j] <- 1 / 12
x[j] ~ dcat(p[j])
},
but this produces an error message of the form
> error for node x[1] of type GraphCat.StdNode node invalid integer
value given
apparently because it is not possible to use dcat with missing data.
The next idea was to use:
for ( j in 1:n ) {
x[j] <- round(x.cont[j])
x.cont[j] ~ dunif(0.5, 12.5)
}
but when I compile this model it (rightly) produces an error message to
say that x[1] has been defined more than once.
Does anyone know if there is a way of doing this within BUGS...?
Many thanks, Adam
--
Dr. Adam Butler
Postdoctoral Research Statistician
Biomathematics & Statistics Scotland
The King's Buildings, Edinburgh EH9 3JZ, UK
Tel: +44(0)131 650 4896
Fax: +44(0)131 650 4901
-------------------------------------------------------------------
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
|