Dear List,
Quantile regression has come up
once or
twice before, but I can't seem to find a reproducible example of anyone who's got it working.
The only MCMC code I can seem to find online is
this example from a JAGS model, based on a data augmentation procedure described by Reed & Yu (2009 )[1].
I've converted it to Stan code (.Rmd file attached, and on GitHub,
here, html output
here), and compared the results to the JAGS output, and results from the bayesQR and quantreg R packages.
Unfortunately I'm getting whacky results out of Stan. I can't seem to get the model to converge, and the coefficients look pretty far off. My questions:
1. Can anyone spot a problem in my Stan code? Some of the warning messages are unexpected. For example, I'm getting warnings that the exponential distribution function is being fed negative values, which shouldn't be possible (tau is constrained to be positive, as far as I've understood my own code).
2. Could it be that this particular algorithm is only suitable for Gibbs sampling? (From skimming the paper, it seems like this may be the case, however, I'm no expert!)
3. If this quantile regression algorithm is peculiar to GIbbs sampling, what procedure, if any, might be appropriate for Stan?
I'm keen to use Stan (as opposed to falling back to JAGS/Gibbs), as the final model I'd like to fit is QR on-top-of a large hierarchical model.
A minimal reproducible example of quantile regression would be an excellent addition to the Stan list/manual!
Best,
Brendan
Reed, C., & Yu, K. (2009). A Partially collapsed Gibbs sampler for Bayesian quantile regression.