Custom Callback in MCMC NUTS for Log Prior / Log Likelihood

I was wondering if for every sample, there is an easy way to get the log likelihood and the log prior separately. I know that there is a potential energy extra state that can be returned for each sample during the MCMC run, I would like return of the log_likelihood and log_prior in the same manner.

Hi @abhi, it is faster to get those stats after obtaining posterior samples. You can use e.g. log_likelihood to get the likelihood. For log_prior, you can mimic the implementation of the log_likelihood utility.