Extract posterior samples as a matrix, array or data frame
as.array.salmonIPMfit.RdPost-warmup samples from a salmonIPMfit object are converted into standard
formats. These S3 methods are wrappers for as.*.stanfit(object$stanfit);
see as.array.stanfit() for details.
Usage
# S3 method for class 'salmonIPMfit'
as.matrix(x, pars = "all", include = TRUE, ...)
# S3 method for class 'salmonIPMfit'
as.array(x, pars = "all", include = TRUE, ...)
# S3 method for class 'salmonIPMfit'
as.data.frame(
x,
pars = "all",
include = TRUE,
row.names = NULL,
optional = FALSE,
...
)Arguments
- x
An object of class salmonIPMfit.
- pars
A character vector specifying (hyper)parameters, states, and/or quantities of interest ("parameters"). Parameters can be explicitly named or one or more shortcuts can be used to specify hierarchical levels of parameters; see
stan_pars()for details. The default is"all"quantities that were monitored.- include
Logical scalar defaulting to
TRUEindicating whether to include or exclude the parameters given bypars.- ...
Currently ignored.
- row.names
NULLor a character vector giving the row names for the data frame. Missing values are not allowed.- optional
logical. If
TRUE, setting row names and converting column names (to syntactic names: seemake.names()) is optional.
See also
salmonIPM(), salmonIPMfit, as.array.stanfit()