How to (re-)sample from an observed random (mixture) variable

I tend to trust sampling a bit more as well. There really not enough theory around automatic VI yet unfortunately.

I think including generative RV in the model is currently unsafe in PyMC3. In theory it should not change the inference as the generative node is conditional on the other parent parameters and has no effect on the overall model inference. But currently it does (see a discussion here):

For sampling, the problem is that the auto compound step does not fully follow the order of the graph, which means you might sometimes end up sampling the generative RV before sampling its parent, which generated a bias because now the parent parameters are depending on the sample of the generative RV. But even when the generative RV is sampled after its parent, it still has an effect on the sampling in the next sample, as the model.logp includes the generative RV and thus the MH update is dependent on the value of the generative RV.

It might work in some model, overall you should always added the generative node after inference, using sample_ppc, eg