Highest density region (source code)

= Highest density region
{title2=$S_c=\{\theta:\pi(\theta)\ge c\}$}

For a probability density $\pi$ and threshold $c>0$, this region includes precisely the points at or above the threshold. It is a <Bayes act> for loss $c|S|-\mathbf1_S(\theta)$, since expected loss is $\int_S(c-\pi(\theta))d\theta$. The minimal value is $-\int(\pi-c)_+d\theta$; adding or removing threshold-equality points does not change it.