EV: Calculate the parameter expectation values for a collection...

Description Usage Arguments Details

View source: R/bayesian.R

Description

Use the parameter sample values to compute expectation values for the parameters. The samples can be either MCMC samples or uniform samples. In the latter case, the values will be weighted by their posterior probabilities.

Usage

1
2
3
4
5
6
7
EV(
  samples,
  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

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. Ignored if weighted==FALSE.

Details

The input to this function can be given either as a grand table (q.v. grand_table_bayes) or as a list of ScenarioInfo objects. Generally this collection will have several model families represented, so the table is split according to the model type. The result will be a table of expectation values by model


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