Learn R Programming

countSTAR (version 1.2.0)

HPDregion: Compute highest posterior density (HPD) regions

Description

Given a vector of draws from the posterior (predictive) distribution, compute a prob their cumulative probability exceeds prob.

Usage

HPDregion(post_pred, prob = 0.95, merge_gaps = FALSE)

Value

An ordered vector of values comprising the HPD region

Arguments

post_pred

vector of draws from the posterior (predictive) distribution

prob

numeric scalar in (0,1) giving the target probability content of the region

merge_gaps

logical; if TRUE, add singleton points that are skipped over