I am trying to emulate the dice problem from Allen Downer’s Think Bayes book in PyMC. The idea is that you have dies of different size (4,6,8,12,20) and you pick one at random and roll it. The question is what can you infer about the picked die given an outcome (e.g., observing a 6).
I tried to model this using a Mixture of Discrete Uniform variables, having a Dirichlet prior for the weights. I would expect that the posterior weight for the first die would be zero, but this is not the case. This model is probably not appropriate for the problem, but I am not sure why. Any ideas?
dice_sizes = np.array((4, 6, 8, 12, 20)) with pm.Model() as m: dice = pm.DiscreteUniform.dist(lower=, upper=dice_sizes) weights = pm.Dirichlet('weights', a=np.ones(len(dice_sizes))) roll = pm.Mixture('roll', comp_dists=dice, w=weights, observed=6, dtype='int64') trace_m = pm.sample(1000)
trace_m['weights'].mean(0) -> array([0.16973499, 0.23528162, 0.21347763, 0.18884671, 0.19265905])
Thank you in advance!