Likelihood of latent variables in hierarchical model for model comparison

The code I made only has obs_x in idata.log_likelihood. Is there a way to get specific probability sums added to log_likelihood?