Bayesian Quantile Regression

The demo code below is estimating a Bayesian quantile regression similar to the one in my paper:

Korobilis, D. (2017). Quantile regression forecasts of inflation under model uncertainty, International Journal of Forecasting, 33, pp. 11-20.

Note that the algorithm I used in my paper was based on the Gibbs sampler of Kozumi, H., and Kobayashi, G. (2011). Gibbs sampling methods for Bayesian quantile regression. Journal of Statistical Computation and Simulation, 81(11), 1565-1578. Their algorithm is based on the Generalized Inverse Gaussian distribution, for which it is not so computationally efficient to sample from. The demo code here provides a more efficient and stable algorithm that replicates Khare, K. and Hobert, J. P. (2012). Geometric ergodicity of the Gibbs sampler for Bayesian quantile regression. Journal of Multivariate Analysis, 112, 108-116. Their algorithm allows to sample from the simpler Inverse Gaussian generator.

This is a demo code and I haven't added a variable selection prior as I did in my article above. For experienced users it should be trivial to convert the Normal prior for β(q) (where q is the quantile) into a spike and slab or other shrinkage prior (e.g. the double-exponential/Laplace prior that leads to lasso, is also trivial to adapt in this case). I do not provide any support for this code, it is only for training purposes for PhDs and other researchers willing to delve deeper into this algorithm.

Download code here: BQR.zip