Learn R Programming

AdjBQR (version 1.0)

BQR: Adjusted Bayesian Quantile Regression

Description

Bayesian quantile regression based on asymmetric Laplace likelihood with posterior variance adjustment

Usage

BQR(y, x, tau, niter = 20000, burn_in = 4000, prop_cov = NULL, level = 0.9)

Arguments

y
the response vector
x
the design matrix. If the first column of x is not all ones, a column of ones will be added.
tau
the quantile level of interest
niter
integer: number of iterations to run the chain for. Default 20000.
burn_in
integer: discard the first burn_in values. Default 100.
prop_cov
covariance matrix giving the covariance of the proposal distribution. This matrix need not be positive definite. If the covariance structure of the target distribution is known (approximately), it can be given here. If not given, the diagonal will be estimated via the Fisher information matrix.
level
nominal confidence level for the credible interval

Value

A list of the following commponents is returnedestpar: posterior mean of the regression coefficient vectorPSD: posterior standard deviation without adjustmentPSD.adj: posterior standard deviation with adjustmentCI.BAL: credible interval without adjustmentCI.BAL.adj: credible interval with adjustmentsig: estimated scale parameterMCMCsize: effective size of the chain

Details

The function returns the unadjusted and adjusted posterior standard deviation, and unadjusted and adjusted credible intervals for Bayesian quantile regression based on asymmetric Laplace working likelihood.

References

Yang, Y., Wang, H. and He, X. (2015). Posterior inference in Bayesian quantile regression with asymmetric Laplace likelihood. International Statistical Review, 2015. doi: 10.1111/insr.12114.

Examples

Run this code
#A simulation example
library(AdjBQR)
n=200
set.seed(12368819)
x1 = rnorm(n)
x2 = rnorm(n)
y=2*x1+2*x2+rt(n,df=3)
x = cbind(1, x1, x2)
## Bayesian quantile regression based on asymmetric Laplace likelihood
BQR(y, x, tau=0.5, level=0.9)

Run the code above in your browser using DataLab