HPDI: Calculate highest posterior density interval (HPDI) for a set...

Description Usage Arguments Value

View source: R/bayesian.R

Description

The HPDI is the interval that contains a specified fraction of the sample points, ordered by posterior probability density.

Usage

1
2
3
4
5
6
7
8
HPDI(
  samples,
  interval = 0.95,
  modelgroup = "expectation.type",
  reportvars = NULL,
  weighted = TRUE,
  lp = "lp_"
)

Arguments

samples

Monte Carlo samples, given either as a grand table or a list of ScenarioInfo objects

interval

The fraction of samples to be contained in the interval

modelgroup

Vector of names of columns that define the model groupings. The default is the single column expectation.type.

reportvars

Vector of names of variables for which to report expectations. The default is all parameter values.

weighted

If TRUE, weight the samples by their posterior.

lp

Name of the column containing the log posterior probability.

Value

List of matrices, one element for each model. Each matrix has parameters in rows and the upper/lower bounds of the interval in its two columns.


JGCRI/gcamland documentation built on Oct. 6, 2020, 5:30 p.m.