Priors for Dirichlet distribution

The direct generalization of your previous prior would be something like

u = pm.Dirichlet('dprior_p', np.ones(4, dtype=np.float32), shape=(4,))
v = pm.Gamma('dprior_v', alpha=1, beta=20, shape=(4,))
p_observed = pm.Dirichlet('proportions', a=u*v, shape=(4,))

It may be more effective to constrain the prior a little bit and let the shape of v be (1,).

There are certainly other things to do as well, but this should give you something to go on. Let me know how these work.

2 Likes