reproduce results in paper "A Comparison of Algorithms for Inference and Learning in Probabilistic Graphical Models "