Applying an MCMC Step to Sample from Distribution with KL Divergence Term

You may want to check out DensityDist instead

https://www.pymc.io/projects/docs/en/stable/api/distributions/generated/pymc.DensityDist.html

Potential works well when you want to adjust the density but you don’t have an underlying RV to sample.

EDIT: Also, if you happen to have the Stan implementation on a public repo and want help porting that over, I’d be happy to take a look.

2 Likes