stanfit objectstanfit
object can be coerced to an array, matrix, or data.frame.
Methods are also provided for checking and setting names and dimnames."as.array"(x, ...) "as.matrix"(x, ...) "as.data.frame"(x, ...) "is.array"(x) "dim"(x) "dimnames"(x) "names"(x) "names"(x) <- valuestanfit.extract
for extracting samples from x. For now, pars
is the only additional parameter supported.
names replacement method, a character vector to
set/replace the parameter names in x.as.array, as.matrix, and as.data.frame return an array,
matrix, and data.frame, respectively.dim and dimnames return the dim and dimnames of the
array object that could be created, while names returns the third
element of the dimnames, which are the names of the margins of the
posterior distribution. The names assignment method allows for
assigning more interpretable names to them.is.array returns TRUE for stanfit objects that include
samples; otherwise FALSE.When the stanfit object does not contain samples, empty objects
are returned from as.array, as.matrix, as.data.frame,
dim, dimnames, and names.
as.array and as.matrix can be applied to a stanfit
object to coerce the samples without warmup to array or matrix.
The as.data.frame method first calls as.matrix and then coerces
this matrix to a data.frame. The array has three named dimensions: iterations, chains, parameters.
For as.matrix, all chains are combined, leaving a matrix of iterations
by parameters.
stanfit and its method extract