I want to define a distribution in my model of the form: P(x=10)=0.10, P(x=15)=0.20, P(x=20)=0.70
The WinBUGS FAQ says it is possible construct my own discrete uniform distribution as a categorical variable with a uniform prior and which can take on the necessary integer values. See the blockerht example in the first part of the manual.
I looked the example up, I think it is this one: "A hierarchical t-distribution with unknown degrees of freedom"
At the model specification they do something like:
for (n in 1:Nbins) {
prior[n] <- 1/Nbins; # Uniform prior on v
}
k ~ dcat(prior[]);
Which does define a discrete uniform. But I don't know how to get to the form I need. Can anyone help me?
If I understand your question correctly, you do not need the loop...
should work...