def CredibleInterval(pmf, percentage=90):
 cdf = pmf.MakeCdf()
 prob = ((1 - (percentage / 100.0)) / 2)
 interval = (cdf.Value(prob), cdf.Value((1 - prob)))
 return interval

def CredibleInterval ( pmf , percentage = 90 ) : cdf = pmf . MakeCdf ( ) prob = ( ( 1 - ( percentage / 100.0 ) ) / 2 ) interval = ( cdf . Value ( prob ) , cdf . Value ( ( 1 - prob ) ) ) return interval
computes a credible interval for a given distribution .