Error when comparing ADVI models with az.compare

Hi,

I found the same issue recently (pymc 4.x). I find out that the computation of the log likelihood is disable on purpose and thus not part of the InferenceData (@ferrine probably knows the reason).

You can still ask pymc to compute the log likelihood for you by doing

trace = mean_field.sample(1000, return_inferencedata=False)
idata = pm.to_inference_data(trace=trace, model=model, log_likelihood=True)

Then you can use that idata to compute LOO.
While this will get the values computed I will be careful about the results until getting more info from @ferrine or others knowing why it is currently disable by default.

4 Likes