pairs method that is customized for MCMC output
1 2 3 4 5 6 7
## S3 method for class 'stanfit' pairs(x, labels = NULL, panel = NULL, ..., lower.panel = NULL, upper.panel = NULL, diag.panel = NULL, text.panel = NULL, label.pos = 0.5 + 1/3, cex.labels = NULL, font.labels = 1, row1attop = TRUE, gap = 1, log = "", pars = NULL, include = TRUE, condition = "accept_stat__")
An object of S4 class
Same as in
Same as in
Same as in
A single number between zero and one exclusive can be passed, which is interpreted as the proportion of realizations (among all chains) to plot in the lower panel starting with the first realization in each chain, with the complement (from the end of each chain) plotted in the upper panel.
A (possibly abbreviated) character vector of length one can be passed among
Logical scalar indicating whether to include (the default) or
excldue the parameters named in the
This method differs from the default
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
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
"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.
You may very well want to specify the
log argument for non-negative
parameters. However, the
pairs function will drop (with a message)
parameters that are either constant or duplicative with previous parameters.
For example, if a correlation matrix is included among
neither its diagonal elements (which are always 1) nor its upper triangular
elements (which are the same as the corresponding lower triangular elements)
will be included. Thus, if
log is an integer vector, it needs to
pertain to the parameters after constant and duplicative ones are dropped.
It is perhaps easiest to specify
log = TRUE, which will utilize
logarithmic axes for all non-negative parameters, except
any integer valued quantities.
1 2 3
Loading required package: ggplot2 Loading required package: StanHeaders rstan (Version 2.15.1, packaged: 2017-04-19 05:03:57 UTC, GitRev: 2e1f913d3ca3) For execution on a local, multicore CPU with excess RAM we recommend calling rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectCores()) rd_st_> csvfiles <- dir(system.file('misc', package = 'rstan'), rd_st_+ pattern = 'rstan_doc_ex_[0-9].csv', full.names = TRUE) rd_st_> fit <- read_stan_csv(csvfiles)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.