Multiple Potentials vs. Single Potential

This question is sort of related to another I asked before (Observed Variable as a Range). I’m wondering if I can and should model the following situation. Each observed data point may have a different likelihood (e.g., some may be uniform, others may be skew-normal, etc.). So I’d like to use pm.Potential to have full control of which likelihood to apply to each observed value. I’m thinking of two approaches:

  • Define a single potential before the call to pm.sample, and in the class that implements the likelihoods and extends tt.Op, I’d add up the log of all density evaluations.

  • Define multiple potentials in a for loop for each observed value before the call to pm.sample, and properly compute the log of density evaluation.

Is the latter approach possible? Any thoughts about them?