Brq: an R package for Bayesian quantile regression

  • PDF / 1,236,987 Bytes
  • 16 Pages / 439.37 x 666.142 pts Page_size
  • 15 Downloads / 301 Views

DOWNLOAD

REPORT


Brq: an R package for Bayesian quantile regression Rahim Alhamzawi1

· Haithem Taha Mohammad Ali2

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 {(xi , yi ); i = 1, 2, . . . , n}, where yi denotes the response variable and xi denotes the k-dimensional vector of covariates. The linear RQ model for the τ th quantile level, τ ∈ (0, 1), is yi = xi βτ + ε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 β

B

n 

ρτ (yi − xi β).

(1)

i=1

Rahim Alhamzawi [email protected]

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

R. Alhamzawi, H. T. M. Ali

Here, ρτ (w) = w{τ − I (w < 0)} and I (.) is the indicator function. Figure 1 shows the check function at three different quantile levels, namely 30%, 15% and 5%, respectively. Since ρτ (w) is not differentiable at 0, a closed form solution is not obtainable for RQ estimators. However, the minimisation of (1) can be efficiently implemented using linear programming [17,19]. From a computational perspective, many well known statistical packages including R, Matlab, SAS, STATA, among others, provide functions for computing the RQ estimator. Although the large sample theory for RQ has been well studied, a Bayesian method enables exact and full inference even when the number of observations is small. However, RQ model does not normally assume a parametric likelihood for the conditional distribution of the response given the covariates. Koenker and Machado [18] showed that ρτ (w) is exactly matched to the asymmetric Laplace distri