draws_list {posterior} | R Documentation |
draws_list
formatThe as_draws_list()
methods convert
objects to the draws_list
format.
The draws_list()
function creates an object of the
draws_list
format based on a set of numeric vectors.
See Details.
as_draws_list(x, ...) ## Default S3 method: as_draws_list(x, ...) ## S3 method for class 'draws_list' as_draws_list(x, ...) ## S3 method for class 'draws_matrix' as_draws_list(x, ...) ## S3 method for class 'draws_array' as_draws_list(x, ...) ## S3 method for class 'draws_df' as_draws_list(x, ...) ## S3 method for class 'draws_rvars' as_draws_list(x, ...) ## S3 method for class 'mcmc' as_draws_list(x, ...) ## S3 method for class 'mcmc.list' as_draws_list(x, ...) draws_list(..., .nchains = 1) is_draws_list(x)
x |
An object to convert to a |
... |
For |
.nchains |
(positive integer) The number of chains. The default is |
Objects of class "draws_list"
are lists with one element per MCMC
chain. Each of these elements is itself a named list of numeric vectors
with one vector per variable. The length of each vector is equal to the
number of saved iterations per chain. See Examples.
A draws_list
object, which has classes
c("draws_list", "draws", "list")
.
Other formats:
draws_array()
,
draws_df()
,
draws_matrix()
,
draws_rvars()
,
draws
x1 <- as_draws_list(example_draws()) class(x1) print(x1) str(x1) x2 <- draws_list(a = rnorm(10), b = rnorm(10), c = 1) class(x2) print(x2) str(x2)