fit-method-output: Access console output

fit-method-outputR Documentation

Access console output

Description

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.

Usage

output(id = NULL)

Arguments

id

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

See Also

CmdStanMCMC, CmdStanMLE, CmdStanVB, CmdStanGQ

Examples

## Not run: 
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()

## End(Not run)


stan-dev/cmdstanr documentation built on April 15, 2024, 9:11 p.m.