addCI: Add simultaneous confidence interval to existing plot.

View source: R/export.R

addCIR Documentation

Add simultaneous confidence interval to existing plot.

Description

Adds simultaneous confidence intervals for quantiles and means to an existing plot.

Usage

addCI(x, CIs, component = 1, bord = NA, mean = TRUE, mean.color = 'plum4',
               quan.color = 'lightsteelblue3', opaq = 0.7, ...)

Arguments

x

: a ‘Smcmc’ class object

CIs

: the output from the 'getCI' function

component

: numeric indicating which component to draw the confidence intervals for

bord

: logical for whether a border is desired around the confidence intervals

mean

: logical argument whether the mean is to be plotted

mean.color

: color for the mean confidence interval

quan.color

: color for the quantile confidence intervals

opaq

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

...

: arguments passed on to the boundaries of the confidence intervals in 'segments'

Value

adds segments for confidence intervals into an already existing plot environment

Examples

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(density(chain$stacked[,1]))
CIs <- getCI(chain)
addCI(chain, CIs, component = 1)

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