Is there a way to call NUTS directly to sample a customized likelihood together with its gradient?

The recommanded approach is create a custom Theano Ops with its gradient. You can see a example here: https://docs.pymc.io/Advanced_usage_of_Theano_in_PyMC3.html#writing-custom-theano-ops and a more in complex example here: https://docs.pymc.io/notebooks/blackbox_external_likelihood.html

2 Likes