Skip to contents

Generic function to convert an object to a posterior::rvar representation. This is typically used to convert MCMC output into a more flexible and vectorized format.

Usage

as_rvar(x, ...)

# S3 method for class 'rjuliabugs'
as_rvar(x, ...)

# S3 method for class 'array'
as_rvar(x, n_mcmc = NULL, ...)

Arguments

x

An object to convert (e.g., a rjuliabugs object or a 3D numeric array).

...

Further arguments passed to specific methods.

n_mcmc

(For arrays only) Number of MCMC chains. Required if x is an array.

Value

An object of class rvar, or an updated rjuliabugs object with params converted to rvar.