How to report on smc's log_marginal_likelihood in pymc5?

I am using Rob Zinkov’s (@zaxtax) superb tour of model checking techniques, from PyMCon 2020. In that tour, Rob uses sample_smc and then reports on log_marginal_likelihood:

Unfortunately, Rob’s work was done in pymc3.9.3. PyMC 5 supports sample_smc, which now provides its trace as a arviz InferenceData object, without a report property. How can log_marginal_likehood be reported now?

Hi @bridgeland the log-marginal-likelihood is stored in the InferenceData object under the sample_stats group.

Following your example it should be partial_smc_trace.sample_stats["log_marginal_likelihood"] you will get one value per chain (two in your example).

3 Likes