After having read the excellent Think Bayes from Allen Downey, I'm now diving deeper into Bayesian Analysis and learning MCMC with Stan.
The dice problem in Think Bayes goes like this:
Suppose I have a box of dice that contains a 4-sided die, a 6-sided die, an 8-sided die, a 12-sided die, and a 20-sided die. Suppose I select a die from the box at random, roll it, and get a 6. What is the probability that I rolled each die?
My goal is to model this with Stan. It seems that the observed data should follow an uniform
distribution between 1 and a second parameter d
that we're trying to guess. Probably d
has a lower
constraint of 4 and an upper
constraint of 20. The following is my best guess of what the model should look like, with the obvious problem that d
is not bounded to the set of hypothesis (and most likely with other issues):
data {
int<lower=0> J; // number of draws
int y[J]; // draws
}
parameters {
real<lower=4,upper=20> d;
}
model {
y ~ uniform(1, d);
}