Convert CmdStanMCMC to mcmc.list — as_mcmc.list • cmdstanr
Description: This function converts a CmdStanMCMC object to an mcmc.list object compatible with the coda package. This is primarily intended for users of Stan coming from BUGS/JAGS who are used to coda for plotting and diagnostics. In general we recommend the more recent MCMC diagnostics in posterior and the ggplot2-based plotting functions in bayesplot, but for users who prefer coda this function provides compatibility.

# Convert `CmdStanMCMC` to `mcmc.list`

Source: `R/utils.R`
`as_mcmc.list.Rd`

This function converts a `CmdStanMCMC` object to an `mcmc.list` object compatible with the coda package. This is primarily intended for users of Stan coming from BUGS/JAGS who are used to coda for plotting and diagnostics. In general we recommend the more recent MCMC diagnostics in posterior and the ggplot2-based plotting functions in bayesplot, but for users who prefer coda this function provides compatibility.

    as_mcmc.list(x)

## Arguments

x

  A CmdStanMCMC object.

## Value

An `mcmc.list` object compatible with the coda package.

## Examples

    # \dontrun{
    fit <- cmdstanr_example()
    x <- as_mcmc.list(fit)
    # }