plot.Smcmc: Plot Smcmc

plot.SmcmcR Documentation

Plot Smcmc

Description

Density plots with simultaenous error bars around means and quantiles for MCMC data. The error bars account for the correlated nature of the process.

Usage

## S3 method for class 'Smcmc'
plot(x, Q = c(0.1, 0.9), alpha = 0.05, thresh = 0.001, iid = FALSE,
                            plot = TRUE, mean = TRUE, border = NA, mean.col = 'plum4', 
                            quan.col = 'lightsteelblue3',rug = TRUE, opaq = 0.7, 
                            auto.layout = TRUE, ask = dev.interactive(),...)

Arguments

x

: a ‘Smcmc’ class object

Q

: vector of quantiles

alpha

: confidence level of simultaneous confidence intervals

thresh

: numeric typically less than .005 for the accuracy of the simulteaneous procedure

iid

: logical argument for constructing density plot for iid samples. Defaults to FALSE

plot

: logical argument for is plots are to be returned

mean

: logical argument whether the mean is to be plotted

border

: whether a border is required for the simultaneous confidence intervals

mean.col

: color for the mean confidence interval

quan.col

: color for the quantile confidence intervals

rug

: logical indicating whether a rug plot is desired

opaq

: opacity of mean.col and quan.col. A value of 0 is transparent and 1 is completely opaque.

auto.layout

: logical argument for an automatic layout of plots

ask

: activating interactive plots

...

: arguments passed on to the density plot in base R

Value

returns a plot of the univariate density estimates with simultaneous confidence intervals wherever asked. If plot == FALSE a list of estimates and simultaneous confidence intervals.

References

Robertson, N., Flegal, J. M., Vats, D., and Jones, G. L., “Assessing and Visualizing Simultaneous Simulation Error”, Journal of Computational and Graphical Statistics, 2020.

Examples

# Producing Markov chain
chain <- matrix(0, ncol = 1, nrow = 1e3)
chain[1,] <- 0
err <- rnorm(1e3)
for(i in 2:1e3)
{
  chain[i,] <- .3*chain[i-1,] + err[i]
}
chain <- Smcmc(list(chain))
plot(chain)


dvats/SimTools documentation built on May 14, 2023, 1:28 p.m.