Okay, I think I understand. I changed my code to the following:
with pm.Model() as model:
lam1 = pm.Exponential('lam1', lam=1.)
offset1 = pm.Categorical('offset1',p=[0.1 for x in range(max(new_stop_pos))])
lam2 = pm.Exponential('lam2', lam=1.)
offset2 = pm.Categorical('offset2',p=[0.1 for x in range(max(new_stop_pos))])
pois1 = pm.Poisson.dist(mu=lam1+offset1)
pois2 = pm.Poisson.dist(mu=lam2+offset2)
w = pm.Dirichlet('w',a=np.array([1.,1.]))
like = pm.Mixture('like',w=w,comp_dists=[pois1,pois2],observed=new_stop_pos)
with model:
trace = pm.sample(50000,n_init=10000,tune=100000)
I’m still not seeing convergence though. The new traceplot looks like this:
Should I be doing something different in order to get better convergence?
