Added method to compute MAP estimate