Inference on PGM