applyConversions {compareMCMCs}R Documentation

Apply a set of parameter conversions to MCMC output


Create transformed parameters from original parameters in MCMC output


applyConversions(samples, conversions)



One of: an MCMCresult object; a named list of MCMCresult objects (such as returned by compareMCMCs); a matrix of MCMC samples (such as the samples element of an MCMCresult object); or a named list of such matrices. In the first two cases, conversions will be done in place (as a "side effect" modifying the arguments) because MCMCresult objects are R6 objects and are thus passed by reference.


One of: a list of conversion specifications (see below); a named list of conversion specifications, with names matching those of a list provided for samples.


A conversion specification is a named list. For each element:

The conversion specification list will be processed in order. This allows creating new columns and removing old ones in a sensible order.

If both conversions and samples are named lists, they will be matched: the conversions element (itself a list of conversion specifications) used on a samples element will have the same name. If there is no conversions element for a given samples element, that samples element will be included in the returned list without any conversions.


An object of the same type as samples after application of conversions.

[Package compareMCMCs version 0.5.0 Index]