Does Pyro need exact formula of posterial distribution or conditional distirbution when fitting complex Bayesian model

I have some general questions regarding Pyro and probabilistic programing. In the context of traditional Bayesian analysis using MCMC algorithm, such as Gibbs sampling and M-H sampling, we have to write down the exact formula of conditional distribution, which might not be feasible for some complex model. But if we use Pyro, we only need to specify prior and likelihood function, and Pyro will automatically fit the model using HMC to generate the sample from posterior distribution. Therefore, it enables us to perform more complex models in practice. Is my understanding right?

Yes, that’s correct. Most of the Monte Carlo algorithms in Pyro and NumPyro, including HMC, require only the ability to sample from base distributions and compute unnormalized joint densities and their gradients.

1 Like