In STAN you cannot sample from discrete variables. You have to marginalize over them with a custom for loop, and then you can draw samples from the posterior by calling the rng function. From what I understand this is a mix of engine limitation as well as intentional design, as samplers for discrete variables are not very efficient / robust.
Is there any easy way to do the same with PyMC? Adding the probability term seems simple with a pm.Potential and a for loop (although I have not tried any example). But I don’t see how to generate back samples from the discrete parameters? Can we somehow use the pm.Deterministic for this?