The reason is that
- pm.Categorical returns an integer between 0 to length of
p, and 0 will cause logp being undefined for Binomial. - poor model parameterization in general as
ncould be smaller thankdata
You can try k= pm.Binomial('k', p=theta, n=n+max(kdata), observed=kdata)