draws_matrix {posterior} | R Documentation |
draws_matrix
formatThe as_draws_matrix()
methods convert
objects to the draws_matrix
format.
The draws_matrix()
function creates an object of the
draws_matrix
format based on a set of numeric vectors.
See Details.
as_draws_matrix(x, ...) ## Default S3 method: as_draws_matrix(x, ...) ## S3 method for class 'draws_matrix' as_draws_matrix(x, ...) ## S3 method for class 'draws_array' as_draws_matrix(x, ...) ## S3 method for class 'draws_df' as_draws_matrix(x, ...) ## S3 method for class 'draws_list' as_draws_matrix(x, ...) ## S3 method for class 'draws_rvars' as_draws_matrix(x, ...) ## S3 method for class 'mcmc' as_draws_matrix(x, ...) ## S3 method for class 'mcmc.list' as_draws_matrix(x, ...) draws_matrix(..., .nchains = 1) is_draws_matrix(x)
x |
An object to convert to a |
... |
For |
.nchains |
(positive integer) The number of chains. The default is |
Objects of class "draws_matrix"
are matrices (2-D arrays) with
dimensions "draw"
and "variable"
. See Examples.
A draws_matrix
object, which has classes
c("draws_matrix", "draws", "matrix")
.
Other formats:
draws_array()
,
draws_df()
,
draws_list()
,
draws_rvars()
,
draws
x1 <- as_draws_matrix(example_draws()) class(x1) print(x1) str(x1) x2 <- draws_matrix(a = rnorm(10), b = rnorm(10), c = 1) class(x2) print(x2) str(x2)