For MCMC, the $output() method returns the stdout and stderr of all chains as a list of character vectors if id=NULL. If the id argument is specified it instead pretty prints the console output for a single chain.

For optimization and variational inference $output() just pretty prints the console output.

output(id = NULL)

Arguments

id

(integer) The chain id. Ignored if the model was not fit using MCMC.

Examples

if (FALSE) { # \dontrun{
fit_mcmc <- cmdstanr_example("logistic", method = "sample")
fit_mcmc$output(1)
out <- fit_mcmc$output()
str(out)

fit_mle <- cmdstanr_example("logistic", method = "optimize")
fit_mle$output()

fit_vb <- cmdstanr_example("logistic", method = "variational")
fit_vb$output()
} # }