It looks like you may be mixing the Potential and DensityDist approaches outlined in Junpeng’s original post. Changing this line:
like = pm.DensityDist('like',
Likelihood,
observed=dict(phi = phi,
d = 1,
value = data)
)
to this:
like = pm.Potential('like', Likelihood(phi, 1, data))
at least gets it sampling. Is that what you intended?