Define hpd function to compute credibility value beta

Warning: It assumes input pdf integrate to 1. We must normalize
our intermediate pdf when assembling the evidence to be consistent.