arviz.hpd(ary, credible_interval=0.94, circular=False)[source]

Calculate highest posterior density (HPD) of array for given credible_interval.

The HPD is the minimum width Bayesian credible interval (BCI). This implementation works only for unimodal distributions.

xNumpy array

An array containing posterior samples

credible_intervalfloat, optional

Credible interval to compute. Defaults to 0.94.

circularbool, optional

Whether to compute the hpd taking into account x is a circular variable (in the range [-np.pi, np.pi]) or not. Defaults to False (i.e non-circular variables).


lower and upper value of the interval.