Calculate an SCB from a samples matrix, which minimizes the absolute distances of the contained samples to a mode vector, at each gridpoint. Therefore the SCB might be considered an “HPD SCB”.

`scrHpd(samples, mode = apply(samples, 1, median), level = 0.95)`

samples

m by n matrix where m is the number of parameters,
n is the number of samples and hence each (multivariate) sample is a column in
the matrix `samples`

mode

mode vector of length m (defaults to the vector of medians)

level

credible level for the SCB (default: 0.95)

A matrix with columns “lower” and “upper”, with the lower and upper SCB bounds, respectively.

Besag, J.; Green, P.; Higdon, D. \& Mengersen, K. (1995):
“Bayesian computation and stochastic systems (with
discussion)”, *Statistical Science*, 10, 3-66.