# Bayesian Quantile Regression

**URL:** <https://discourse.mc-stan.org/t/bayesian-quantile-regression/29894>\
**Category:** Modeling\
**Created:** [December 28, 2022, 9:24am UTC](https://discourse.mc-stan.org/t/bayesian-quantile-regression/29894 "2022-12-28T09:24:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steviey](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/steviey/32/15581_2.png) [@Steviey](https://discourse.mc-stan.org/u/Steviey)\
**Post date:** [December 28, 2022, 9:24am UTC](https://discourse.mc-stan.org/t/bayesian-quantile-regression/29894/1 "2022-12-28T09:24:59Z")

</div>

**Why this is not working, how can we hint it?..**

`myModel <- brms::brm(brms::bf(myFormula, quantile=seq(0.1, 0.9, by = 0.1)), data = df_train, family = asym_laplace(),chains=myChains,iter=myIter) `  
Caused by error:  
! Expecting a single value when fixing parameter ‘quantile’.

---

<div class="post-metadata">

**Author:** ![AWoodward](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/awoodward/32/13015_2.png) [@AWoodward](https://discourse.mc-stan.org/u/AWoodward)\
**Post date:** [December 31, 2022, 5:50am UTC](https://discourse.mc-stan.org/t/bayesian-quantile-regression/29894/2 "2022-12-31T05:50:05Z")

</div>

hello @Steviey this error is occurring because you aren’t allowed to specify more than one conditional quantile. You will need a separate model for each quantile.

Models for multiple quantiles are generally supported by frequentist methods, but the asymmetric Laplace based approach to quantile regression will not allow this. The model works by setting the target quantile equal to the location of the distribution, which means that it can only handle one quantile at a time. Find the full description here ([https://doi.org/10.1016/S0167-7152(01)00124-9](https://doi.org/10.1016/S0167-7152(01)00124-9)).

There are some described approaches to Bayesian quantile modelling for multiple quantiles, but to my understanding they would not be readily compatible with Stan.
