Learn R Programming

posterior (version 1.6.0)

merge_chains: Merge chains of draws objects

Description

Merge chains of draws objects into a single chain. Some operations will trigger an automatic merging of chains, for example, because chains do not match between two objects involved in a binary operation. By default, no warning will be issued when this happens but you can activate one via options(posterior.warn_on_merge_chains = TRUE).

Usage

merge_chains(x, ...)

# S3 method for draws_matrix merge_chains(x, ...)

# S3 method for draws_array merge_chains(x, ...)

# S3 method for draws_df merge_chains(x, ...)

# S3 method for draws_list merge_chains(x, ...)

# S3 method for rvar merge_chains(x, ...)

# S3 method for draws_rvars merge_chains(x, ...)

Value

A draws object of the same class as x.

Arguments

x

(draws) A draws object or another R object for which the method is defined.

...

Arguments passed to individual methods (if applicable).

Examples

Run this code
x <- example_draws()

# draws_array with 4 chains, 100 iters each
str(x)

# draws_array with 1 chain of 400 iterations
str(merge_chains(x))

Run the code above in your browser using DataLab