quant_bdr.Rd
quant_bdr
converts a bayesian distribution regression matrix from par_distreg
output to a matrix of quantile distribution.
quant_bdr(taus, thresh, mat)
taus | a vector of quantile indices |
---|---|
thresh | a vector of threshold values used in a |
mat | bayesian distribution regression output matrix; columns should correspond to draws of the distribution function |
qmat matrix of quantile distribution
set.seed(2); Fmat = matrix(runif(1000),1000,10); taus = seq(0,1, length.out=1000) thresh = qnorm(taus) par(mfrow=c(1,2)) plot(thresh,sort(apply(apply(Fmat,2,sort),1,mean)),type="l",xlab="y",ylab="F(y)", main="Distribution Function") qmat<- quant_bdr(taus,thresh,Fmat); plot(taus,apply(qmat,1,mean),type = "l", xlab="tau",ylab="Qy",main="Quantile Function")