quant_bdr: Quantile conversion of a bayesian distribution matrix

View source: R/Functions.R

quant_bdrR Documentation

Quantile conversion of a bayesian distribution matrix

Description

quant_bdr converts a bayesian distribution regression matrix from par_distreg output to a matrix of quantile distribution.

Usage

quant_bdr(taus, thresh, mat)

Arguments

taus

a vector of quantile indices

thresh

a vector of threshold values used in a par_distreg type function

mat

bayesian distribution regression output matrix; columns should correspond to draws of the distribution function

Value

qmat matrix of quantile distribution

Examples

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")
par(mfrow=c(1,1))

estsyawo/bayesdistreg documentation built on Jan. 28, 2024, 12:13 p.m.