draws_array {posterior} | R Documentation |
The draws_array
format
Description
The as_draws_array()
methods convert
objects to the draws_array
format.
The draws_array()
function creates an object of the
draws_array
format based on a set of numeric vectors.
See Details.
Usage
as_draws_array(x, ...)
## Default S3 method:
as_draws_array(x, ...)
## S3 method for class 'draws_array'
as_draws_array(x, ...)
## S3 method for class 'draws_matrix'
as_draws_array(x, ...)
## S3 method for class 'draws_df'
as_draws_array(x, ...)
## S3 method for class 'draws_list'
as_draws_array(x, ...)
## S3 method for class 'draws_rvars'
as_draws_array(x, ...)
## S3 method for class 'mcmc'
as_draws_array(x, ...)
## S3 method for class 'mcmc.list'
as_draws_array(x, ...)
draws_array(..., .nchains = 1)
is_draws_array(x)
Arguments
x |
An object to convert to a |
... |
For |
.nchains |
(positive integer) The number of chains. The default is |
Details
Objects of class "draws_array"
are 3-D arrays with dimensions
"iteration"
, "chain"
, and "variable"
. See Examples.
Value
A draws_array
object, which has classes
c("draws_array", "draws", "array")
.
See Also
Other formats:
draws
,
draws_df()
,
draws_list()
,
draws_matrix()
,
draws_rvars()
Examples
x1 <- as_draws_array(example_draws())
class(x1)
print(x1)
str(x1)
x2 <- draws_array(a = rnorm(10), b = rnorm(10), c = 1)
class(x2)
print(x2)
str(x2)
[Package posterior version 1.6.0 Index]