Can you marginalize a mixture model where the draws from the different components are not independent?

:medal_sports: to PyMC for allowing me to sample from the model without math tricks :smiley:

I had one final question: One downside of the potential trick is that I can’t sample new draws from this distribution directly, as sample_posterior_predictive(trace, var_names=["group_assignment", "y"]) ignores the potential. I’ve solved this in a hacky way by setting p to 0 and 1 to sample from the pure distribution, and then combining such samples manually. But it would of course be nice to be able to sample from the model directly. Is it possible to rewrite it in some way to enable this? My understanding is that it’s impossible as the potential is by necessity downstream of the group assignment. But am I missing something clever?