plotMCMC_RStan: Make diagnostic plots for a parameter in an rstan mcmc...

View source: R/plotMCMC_RStan.R

plotMCMC_RStanR Documentation

Make diagnostic plots for a parameter in an rstan mcmc simulation

Description

Function to make diagnostic plots for a parameter in an rstan mcmc simulation.

Usage

plotMCMC_RStan(mcmc, var, label = var)

Arguments

mcmc
  • rstan stanfit object from running rstan::sampling() or tmbstan::tmbstan()

var
  • name of variable to plot

label
  • label to use for variable (default=var)

Details

Requires the rstan and cowplot packages. Combines plots from running rstan::stan_trace(), rstan::stan_ac() (both ACF and PACF plots), rstan::stan_hist(), and rstan::stan_dens() for the model parameter identified by var Plots are combined using cowplot::plot_grid(). The label input can be specified to provide a more informative name for the plotted parameter.

Value

a ggplot2::gg object (or NULL if the rstan package is not installed.)


wStockhausen/wtsPlots documentation built on July 19, 2023, 8:15 p.m.