Estimate log likelihood of ground truth values using trace from sample_posterior_predictive

I have a model in PyMC v5.18, fit to some observations. I simulated posterior values in a somewhat different model (with much overlap to the original model of course), using pm.sample_posterior_predictive(), predicting distributions as traces for several RVs. Now I would like to measure the log likelihood of the ground truth values for those RVs, based on the traces and model.

What’s the best way to do this? Or is this a dumb way to measure the quality of the second model?

Wups! I asked the same question four years ago.

Nevermind.

2 Likes

Glad you found an answer. Good thing we keep all these questions and answers around!

1 Like