arviz.hpd(x, 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.

x : Numpy array

An array containing posterior samples

credible_interval : float, optional

Credible interval to compute. Defaults to 0.94.

circular : bool, 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.