Learn R Programming

CARBayes (version 4.2)

summarise.samples: Summarise a matrix of Markov chain Monte Carlo samples.

Description

This function takes in a matrix of Markov chain Monte Carlo (McMC) samples from a `carbayes' model object, such as a set of parameters or fitted values, and calculates posterior quantiles and exceeedence probabilities. The latter are probabilities of the form P(quantity > c|data), where c is a threshold chosen by the user.

Usage

summarise.samples(samples, columns=NULL, quantiles=0.5, exceedences=NULL)

Arguments

samples
A matrix of McMC samples obtained from a `carbayes' model object.
columns
A vector of column numbers stating which columns in the matrix of McMC samples summaries are required for. Defaults to all columns.
quantiles
The vector of posterior quantiles required.
exceedences
The vector of threshold levels, c, that exceedence probabilities are required for.

Value

  • quantilesA 2 dimensional array containing the requied posterior quantiles. Each row relates to a parameter and each column to a different requested quantile.
  • exceedencesA 2 dimensional array containing the requied exceedence probabilities. Each row relates to a parameter, and each column to a different requested exceedence probability.

Examples

Run this code
## See the vignette accompanying this package for an example of its use.

Run the code above in your browser using DataLab