Discrete hyper-parameter input for Dirichlet prior

I’m opening up the number of bins in a step-function model to sampling.

Want to do something like this:

M = pm.DiscreteUniform(‘M’,lower=1,upper=50)
weights = pm.Dirichlet(‘weights’,a=np.ones(M))

But it doesn’t work. I get:
“TypeError: expected sequence object with len >= 0 or a single integer”

Is there a way to do this?

Hi,
Try specifying the shape of your distributions (especially the Dirichlet I think) with the shape arg.
Hope this helps :vulcan_salute: