Hi Chris,
Thanks for the input.
You are right that ignoring Z amounts to having samples from p(\theta | \mathcal{D}). However, this marginalises over the posterior of Z, rather than the prior over Z, so this isn’t the integral that I actually want to perform.
I don’t believe that the sampling procedure that I suggested and running MCMC should give the same results, because of the above issue.