quantile_hdi | R Documentation |
quantile_hdi
computes any number of highest density quantiles from a
sample of representative values, estimated as shortest credible intervals. If
quantile
contains 0, 0.5, or 1, will return the minimum, median, and
maximum respectively.
quantile_hdi(var, quantile, moment = "mean", ...)
var |
A vector of representative values from a probability distribution (e.g., MCMC samples). |
quantile |
A vector of quantiles to return. |
moment |
A string indicating the first moment to return ("mean" or
"median") if |
... |
Internal arguments. |
A sorted vector with all specified quantiles.
p_density <- rnorm(100, 2, 0.5)
quantile_hdi(p_density, c(0, 0.025, 0.5, 0.0975, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.