simcnfB {bayesdistreg} | R Documentation |
simcnfB
obtains symmetric bayesian distribution confidence bands
simcnfB(DF, DFmat, alpha = 0.05, scale = FALSE)
DF |
the target distribution/quantile function as a vector |
DFmat |
the matrix of draws of the distribution, rows correspond to
elements in |
alpha |
level such that |
scale |
logical for scaling using the inter-quartile range |
cstar - a constant to add and subtract from DF to create confidence bands if no scaling=FALSE else a vector of length DF.
set.seed(14); m=matrix(rbeta(500,1,4),nrow = 5) + 1:5 DF = apply(m,1,mean); plot(1:5,DF,type="l",ylim = c(0,max(m)), xlab = "Index") symCB<- simcnfB(DF,DFmat = m) lines(1:5,DF-symCB,lty=2); lines(1:5,DF+symCB,lty=2)