Plot a function together with its confidence/credible bands
This routine typically plots a function together with its confidence or credible bands. The credible band can be indicated either by additional lines or by a shaded region or by both.
cbplot(x, y, low, upp, type=c("l", "s"), band.type=c("ls", "s", "l"), add=FALSE, col="darkblue", lty=1, lwd=2, cbcol=col, cblty=4, cblwd=lwd, scol=rainbow_hcl(1, start=180, end=180), slwd=5, xlim, ylim, xlab, ylab, main="", sub="", cex.lab=1, cex.axis=1, ...)
x |
a numeric vector with |
y |
a numeric vector with |
low |
a numeric vector with |
upp |
a numeric vector with |
type |
argument with the same meaning as |
band.type |
a character which specifies the graphical way to show the credible band, “ls” stands for line and shaded region, “s” stands for shaded region only and “l” stands for line only. |
add |
if |
col, lty, lwd |
graphical paramters to draw the x-y line. |
cbcol, cblty, cblwd |
graphical parameters to draw the x-low and x-upp lines. |
scol, slwd |
graphical parameters for the shaded region between the credible/confidence bounds. |
xlim, ylim, xlab, ylab, main, sub, cex.lab, cex.axis |
other graphical parameters. |
... |
additional arguments passed to the |
invisible(x)
Arnošt Komárek arnost.komarek[AT]mff.cuni.cz
### Artificial credible bands around the CDF's of N(100, 15*15) ### and N(80, 10*10) iq <- seq(55, 145, length=100) Fiq <- pnorm(iq, 100, 15) low <- Fiq - 0.1 upp <- Fiq + 0.1 iq2 <- seq(35, 125, length=100) Fiq2 <- pnorm(iq, 80, 10) low2 <- Fiq2 - 0.1 upp2 <- Fiq2 + 0.1 cbplot(iq, Fiq, low, upp, xlim=c(35, 145)) cbplot(iq2, Fiq2, low2, upp2, add=TRUE, col="red4", scol=rainbow_hcl(1, start=20, end=20))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.