Building a hierarchical model using a Black Box loglikelihood function

I have a question about how to build a hierarchical model using the black box loglikelihood tutorial notebook. In that example, one data set is provided, then the loglikelihood of that data set is calculated using pm.Potential.

Say instead you have 50 data sets you want to fit hierarchically. What does PyMC require be output by Potential in that situation? Should it output a single loglikelihood value corresponding to the total loglikelihood of all participants combined? Or, should it output a vector containing the loglikelihood for each individual data set? Appreciate any input on this!

It doesn’t matter. The outputs of a Potential will be summed anyway. For sampling purposes the model logp is always reduced into a scalar.