Observed Negative Potential Energy with NUTS Sampler

Hi there,

I’m debugging my hierarchical multinomial logit model (which is a bit complex) that get stucked at very early iterations and I tried to simplify the model to get a minimum version that works properly.

Now I have a simplified version seems to have a normal -log_likelihood (-potential energy) curve, but when I looking at the values I found that the potential energy becomes negative after some iterations.

Here is a segment of the potential energy array where it turns from pos to neg:

1.4578748e+03, 1.3394178e+03, 1.2372814e+03,
9.7788623e+02, 6.7353839e+02, 4.4601050e+02,
2.3404785e+02, 9.1659241e+01, -1.0517139e+02,
-2.5695007e+02, -3.7658270e+02, -3.8519507e+02,

My question is – Is this expected in Numpyro?
If so, what’s the underlying mechanism about it?
If not, what’s potential problems with my code/model?
I can provide more infos about my implementation if needed.

Many Thanks!

this is expected and nothing to worry about. the log of continuous probability densities can be arbitrarily large and negative or arbitrarily large and positive. so the same can happen here. in physics there’s a convention to define potential energies so that they’re bounded from below by zero. but that’s just a convention; only the gradient of the potential energy matters (at least in classical mechanics)

Got it. Thank you very much!