Learn R Programming

mcmcr (version 0.0.2)

combine_samples: Combine MCMC Samples of Two Objects

Description

Combines samples of two MCMC objects (with the same parameters, chains and iterations) using a function.

Usage

combine_samples(x, x2, fun = mean, ...)

# S3 method for mcmcarray combine_samples(x, x2, fun = mean, ...)

# S3 method for mcmcr combine_samples(x, x2, fun = mean, ...)

Arguments

x

An MCMC object.

x2

A second MCMC object.

fun

The function to use to combine the samples. The function must return a scalar.

...

Unused.

Value

The combined samples as an MCMC object with the same parameters, chains and iterations as the original objects.

Methods (by class)

  • mcmcarray: Combine samples of two mcmcarray objects

  • mcmcr: Combine samples of two mcmcr objects

Examples

Run this code
# NOT RUN {
combine_samples(mcmcr_example, mcmcr_example, fun = sum)
# }

Run the code above in your browser using DataLab