getBands {qrjoint} | R Documentation |
Posterior Credible Bands
Description
Calculate and display credible bands of a vector of parameters from a sample of draws. Most suitable when the vector represents a discretized version of a function.
Usage
getBands(b, col = 2, lwd = 1, plot = TRUE, add = FALSE,
x = seq(0,1,len=nrow(b)), remove.edges = TRUE, ...)
Arguments
b |
a matrix of sampled draws of a vector, columns giving samples and rows giving elements of the vector |
col |
color of the median line and 95% bands, usual color codes could be used |
lwd |
line width for the median line |
plot |
logical indicating whether plots are to be drawn, default is |
add |
logical indicating whether plot is to be added to existing plot, default is |
x |
indexing the parameter coordinates. When |
remove.edges |
logical indicating whether the first and last entries of |
... |
limited number of plotting parameters |
Value
returns median, 2.5th and 97.5th percentiles as a 3-column matrix.
See Also
Examples
## toy example
x <- 2*pi*seq(0,1,.01)
fsamp <- replicate(100, rnorm(1,0,0.1) + rnorm(1,1,0.2) * cos(x))
getBands(fsamp)
getBands(fsamp, x = x, col = 3, remove.edges = FALSE, xlab = "x", ylab = "f", bty = "n")
getBands(fsamp, x = x, col = "darkgreen", remove.edges = FALSE, xlab = "x", ylab = "f")