combine_samples: Combine MCMC samples of two objects

Description Usage Arguments Value See Also Examples

View source: R/combine-samples.R

Description

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

Usage

1
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.

See Also

Other combine: combine_dimensions(), combine_samples_n()

Examples

1

Example output

$alpha
[1] 7.43605 9.43605

nchains:  2 
niters:  400 

$beta
         [,1]     [,2]
[1,] 1.943307 3.943307
[2,] 3.943307 5.943307

nchains:  2 
niters:  400 

$sigma
[1] 1.582395

nchains:  2 
niters:  400 

mcmcr documentation built on Sept. 7, 2021, 1:07 a.m.