Added method compute_posteriors