Create a draws
object supported by the posterior package. These
methods are just wrappers around CmdStanR's $draws()
method provided for convenience.
# S3 method for class 'CmdStanMCMC'
as_draws(x, ...)
# S3 method for class 'CmdStanMLE'
as_draws(x, ...)
# S3 method for class 'CmdStanLaplace'
as_draws(x, ...)
# S3 method for class 'CmdStanVB'
as_draws(x, ...)
# S3 method for class 'CmdStanGQ'
as_draws(x, ...)
# S3 method for class 'CmdStanPathfinder'
as_draws(x, ...)
A CmdStanR fitted model object.
Optional arguments passed to the $draws()
method (e.g., variables
, inc_warmup
, etc.).
To subset iterations, chains, or draws, use the
posterior::subset_draws()
method after creating the draws
object.
if (FALSE) { # \dontrun{
fit <- cmdstanr_example()
as_draws(fit)
# posterior's as_draws_*() methods will also work
posterior::as_draws_rvars(fit)
posterior::as_draws_list(fit)
} # }