The Markov Chain Monte Carlo (MCMC) is a sampling method to sample from a probability distribution when direct sampling is not feasible.

The implementation of Monte Carlo in the TensorFlow Probability package included sample to run the Hamiltonian MCMC, which is a variation with input from the Hamiltonian dynamics to avoid slow exploration of state space.

While running the samples, my Python reported errors on importing **tensorflow_probability**:

The problem is resolved by uninstalling and re-installing the tensorflow-estimator package:

pip uninstall tensorflow_estimator pip install tensorflow_estimator

Finally the samples run fine with expected results.

The results from the sample run.