mcmc_plot.varstan: MCMC Plots Implemented in 'bayesplot'

Description Usage Arguments Value Examples

View source: R/autoplot.R

Description

Convenient way to call MCMC plotting functions implemented in the bayesplot package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'varstan'
mcmc_plot(
  object,
  pars = NULL,
  combo = c("dens", "trace"),
  fixed = FALSE,
  exact_match = FALSE,
  ...
)

mcmc_plot(object, ...)

Arguments

object

An varstan object.

pars

Names of parameters to be plotted, as given by a character vector or regular expressions. By default, all parameters except for group-level and smooth effects are plotted. May be ignored for some plots.

combo

An array that contains the types of plot. By default combo = c("dens","trace"). Supported types are (as names) hist, dens, hist_by_chain, dens_overlay, violin, intervals, areas, acf, acf_bar,trace, trace_highlight, scatter, rhat, rhat_hist, neff, neff_hist nuts_acceptance, nuts_divergence, nuts_stepsize, nuts_treedepth, and nuts_energy. For an overview on the various plot types see MCMC-overview.

fixed

Indicates whether parameter names should be matched exactly (TRUE) or treated as regular expressions (FALSE). Default is FALSE.

exact_match

Deprecated alias of argument fixed.

...

Additional arguments passed to the plotting functions. See MCMC-overview for more details.

Value

A ggplot object that can be further customized using the ggplot2 package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
sf1 = stan_ssm(ipc,iter = 500,chains = 1)

# plot posterior intervals
mcmc_plot(sf1)

# only show population-level effects in the plots
mcmc_plot(sf1, pars = "level")

## End(Not run)

bayesforecast documentation built on June 17, 2021, 5:14 p.m.