Learn R Programming

glmBfp (version 0.0-60)

scrHpd: Calculate an SCB from a samples matrix

Description

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”.

Usage

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

Arguments

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)

Value

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

References

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

See Also

empiricalHpd