METRON
https://doi.org/10.1007/s40300-020-00190-6
Brq: an R package for Bayesian quantile regression
Rahim Alhamzawi
1
· Haithem Taha Mohammad Ali
2
Received: 27 February 2020 / Accepted: 26 September 2020
© Sapienza Università di Roma 2020
Abstract
Bayesian regression quantile has received much attention in recent literature. The objective
of this paper is to illustrate Brq, a new software package in R. Brq allows for the Bayesian
coefficient estimation and variable selection in regression quantile (RQ) and support Tobit
and binary RQ. In addition, this package implements the Bayesian Tobit and binary RQ with
lasso and adaptive lasso penalties. Further modeling functions for summarising the results,
drawing trace plots, posterior histograms, autocorrelation plots, and plotting quantiles are
included.
Keywords Bayesian quantile · Lasso · Adaptive lasso · Prior elicitation · Tobit
1 Introduction
Regression quantile (RQ), introduced by Koenker and Bassett [16], models the conditional
quantiles of the outcome of interest as a function of the predictors. Since its introduction, RQ
has been a topic of great theoretical concern as well as large applications in many research
areas such as econometrics, marketing, medicine, ecology, and survival analysis [9,13,26].
Suppose that we have a sample of observations {(x
i
, y
i
); i = 1, 2,..., n}, where y
i
denotes
the response variable and x
i
denotes the k -dimensional vector of covariates. The linear RQ
model for the τ th quantile level, τ ∈ (0, 1), is y
i
= x
′
i
β
τ
+ ε
i
, where β
τ
is a vector of
coefficients dependent on τ and ε
i
’s are independent with their τ th quantile level equal to
zero. For simplicity of notation, we will omit the subscript τ from β
τ
in the remainder of the
paper.
In the classical literature, the error density is often left unspecified and the unknow vector
β is estimated by solving [16]
min
β
n
i =1
ρ
τ
( y
i
− x
′
i
β). (1)
B Rahim Alhamzawi
rahim.alhamzawi@qu.edu.iq
1
Department of Statistics, College of Administration and Economics, University of Al-Qadisiyah, Al
Diwaniyah, Iraq
2
Department of Economics, Nawroz University, Duhok, Iraq
123