Difference between DensityDist and Potential?

Correct me if I’m wrong but this sounds like potential serves as an added term to the logp. Kind of in software programming you have:

func(): doSomething();
subfunc(): super(func); dosomethingextra();

Where the potential is equal to the subfunc. If my likelihood in the model is defined as the Potential (with no other observed= fields anywhere else) then that is the entire likelihood right? sorry if that doesn’t make much sense, I have a basic sense of how samplers work (and mainly metropolis). What I want to ask is, are the two code the same?

with pm.Model():
    a = pm.Normal('a', mu=0, sd=1, observed=y)

vs

with pm.Model():
    a = pm.Potential('a', pm.Normal.dist(mu=0, sd=1).logp(y))
4 Likes