Bayesian Model Comparison for SVI: Marginalised Likelihood

Hi, Suppose I’m trying to fit data with several models with a different number of parameters using SVI with TraceEnum_ELBO in pyro. Now I want to implement the Bayesian Model Selection Strategy, which is

where Mi stands for the ith Model while D is the given data.

My model is high-dimension and moreover includes discrete variables as well, thus it should be difficult to do the integration on the joint distribution (I haven’t tried it yet and am happy to know if it’s actually possible). Therefore I’m wondering if it’s possible to obtain the (approximated) marginalized likelihood P(D | Mi) for the model selection purpose? I’m using the Multivariate Normal Auto guide and using the enumeration method to deal with the discrete variables.

If the above method is hard to realize, could you please suggest any other method to do model comparison in SVI using pyro? I think it’s not ideal to directly compare the TraceEnum_ELBO since the models have different parameter settings.

I’m particularly interested in the case where the models have discrete categorical parameters.

Thank you so much!