asymcnfB: Asymmetric simultaneous bayesian confidence bands

Description Usage Arguments Value Examples

View source: R/Functions.R

Description

asymcnfB obtains asymmetric bayesian distribution confidence bands

Usage

1
asymcnfB(DF, DFmat, alpha = 0.05, scale = FALSE)

Arguments

DF

the target distribution/quantile function as a vector

DFmat

the matrix of draws of the distribution, rows correspond to elements in DF

alpha

level such that 1-alpha is the desired probability of coverage

scale

logical for scaling using the inter-quartile range

Value

cstar - a constant to add and subtract from DF to create confidence bands if no scaling=FALSE else a vector of length DF.

Examples

1
2
3
4
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(min(m),max(m)), xlab = "Index")
asyCB<- asymcnfB(DF,DFmat = m)
lines(1:5,DF-asyCB$cmin,lty=2); lines(1:5,DF+asyCB$cmax,lty=2)

bayesdistreg documentation built on May 1, 2019, 8:03 p.m.