stanfit objectpairs method that is customized for MCMC output## S3 method for class 'stanfit':
pairs(x, labels = NULL, panel = NULL, \dots, lower.panel = NULL,
upper.panel = NULL, diag.panel = NULL, text.panel = NULL,
label.pos = 0.5 + has.diag/3, cex.labels = NULL, font.labels = 1,
row1attop = TRUE, gap = 1, pars = NULL, condition = "accept_stat__",
include = TRUE)stanfitpairs syntactically but see the Details section for different
default argumentspairsNULL, a character vector indicating which quantities
to include in the plots, which is passed to extract. Thus,
by default, all unknown quantities are included, which may be far NULL, it will plot roughly half of the
chains in the lower panel and the rest in the upper panel. An
integer vector can be passed to select some subset of the chains, of which
roughly half will be plotted in the lower panel andpars argument from the plot.pairs method in the following
ways. If unspecified, the smoothScatter function is used for the
off-diagonal plots, rather than points, since the former is more
appropriate for visualizing thousands of draws from a posterior distribution.
Also, if unspecified, histograms of the marginal distribution of each quantity
are placed on the diagonal of the plot, after pooling all of the chains specified
by the chain_id argument.
The draws from the warmup phase are always discarded before plotting.
By default, the lower (upper) triangle of the plot contains draws with below
(above) median acceptance probability. Also, if condition is not
"n_divergent__", red points will be superimposed onto the smoothed
density plots indicating which (if any) iterations encountered a divergent
transition. Otherwise, yellow points indicate a transition that hit the
maximum treedepth rather than terminated its evolution normally.stanfit and its method extract as
well as the pairs generic function. Also, see
get_sampler_params and get_logposterior.example(read_stan_csv)
pairs(fit, pars = c("mu", "sigma", "alpha", "lp__"))Run the code above in your browser using DataLab