Pointwise log likelihood values can be obtained by evaluating logp_elemwise
for all observed variables, here is how it is done in ArviZ. I would not recommend this approach though, adding a couple lines to sum or concat the multiple likelihoods will most surely be easier to implement and to understand when coming back to the code.
The same is probably true when trying to rewrite the model so it has only one observed variable, not only you are bound to end up with harder to understand code but you could also end up having a multimodal distribution and making sampling harder and slower.
We have improved waic
and loo
since I wrote that post, so now things should be a little bit simpler. var_name
argument has been added. Therefore, the last example can be simplified to:
az.waic(idata, var_name="away_points")
And the first example could now be:
idata.log_likelihood["log_lik_sum"] = log_lik.home_points + log_lik.away_points
az.waic(idata, var_name="log_lik_sum")
This makes clearer what is waic
being calculated for and makes it easier to calculate waic
for different approaches without having to repeat any calculation, only changing the var_name
is enough.
If you were interested in the log likelihood value (which is not useful to calculate waic
but can have other uses) in addition to the pointwise ones you should read this other answer