A CmdStanMCMC object is the fitted model object returned by the $sample() method of a CmdStanModel object. Like CmdStanModel objects, CmdStanMCMC objects are R6 objects.


CmdStanMCMC objects have the following methods:

$draws()Return posterior draws as a draws_array.
$sampler_diagnostics()Return sampler diagnostics as a draws_array.
$summary()Run posterior::summarise_draws().
$cmdstan_summary()Run and print CmdStan's bin/stansummary.
$cmdstan_diagnose()Run and print CmdStan's bin/diagnose.
$save_output_files()Save output CSV files to a specified location.
$save_data_file()Save JSON data file to a specified location.
$save_latent_dynamics_files()Save diagnostic CSV files to a specified location.
$time()Return a list containing the total time and a data frame of execution times of all chains.
$output()Return the stdout and stderr of all chains as a list of character vectors, or pretty print the output for a single chain if id argument is specified.

See also

The CmdStanR website (mc-stan.org/cmdstanr) for online documentation and tutorials.

The Stan and CmdStan documentation:

Other fitted model objects: CmdStanMLE, CmdStanVB