# Specifying different priors for different coefficients in RStanARM?

**URL:** <https://discourse.mc-stan.org/t/specifying-different-priors-for-different-coefficients-in-rstanarm/13022>\
**Category:** rstanarm\
**Created:** [February 8, 2020, 4:15am UTC](https://discourse.mc-stan.org/t/specifying-different-priors-for-different-coefficients-in-rstanarm/13022 "2020-02-08T04:15:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![blakeobeans](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/blakeobeans/32/3108_2.png) [@blakeobeans](https://discourse.mc-stan.org/u/blakeobeans)\
**Post date:** [February 8, 2020, 4:15am UTC](https://discourse.mc-stan.org/t/specifying-different-priors-for-different-coefficients-in-rstanarm/13022/1 "2020-02-08T04:15:45Z")

</div>

Is there a way to specify different priors in RStanARM?  
In Stan, you can do x1 ~ normal(0,1), x2 ~ normal(0,3), etc…  
I do not see a way to do that in RStanARM- only prior, prior\_intercept and prior\_aux.

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [February 8, 2020, 7:01am UTC](https://discourse.mc-stan.org/t/specifying-different-priors-for-different-coefficients-in-rstanarm/13022/2 "2020-02-08T07:01:58Z")

</div>

It is like

```
prior = normal(location = 0, scale = c(1, 3))

```

perhaps with `auto_scale = FALSE`.

---

<div class="post-metadata">

**Author:** ![Ara\_Winter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ara_winter/32/4284_2.png) [@Ara\_Winter](https://discourse.mc-stan.org/u/Ara_Winter)\
**Post date:** [February 8, 2020, 2:25pm UTC](https://discourse.mc-stan.org/t/specifying-different-priors-for-different-coefficients-in-rstanarm/13022/3 "2020-02-08T14:25:13Z")

</div>

Yeah it’s like @bgoodri said.

> kickstarter\_priors ← normal(location = c(-1, 0.5, 0.5),  
> scale = c(0.5, 0.5, 0.5), autoscale = FALSE)

---

<div class="post-metadata">

**Author:** ![ermeel](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ermeel/32/4180_2.png) [@ermeel](https://discourse.mc-stan.org/u/ermeel)\
**Post date:** [April 2, 2020, 10:23am UTC](https://discourse.mc-stan.org/t/specifying-different-priors-for-different-coefficients-in-rstanarm/13022/4 "2020-04-02T10:23:27Z")

</div>

I presume, in general, parameters have to be sorted alphabetically in order to related them to coefficients? It is not possible to provide named vectors or lists for `location` or `scale`?

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [April 2, 2020, 1:25pm UTC](https://discourse.mc-stan.org/t/specifying-different-priors-for-different-coefficients-in-rstanarm/13022/5 "2020-04-02T13:25:17Z")

</div>

They variables don’t have to be sorted alphabetically, but the priors do take vectors only (possibly with recycling). So, the vectors different locations and / or scales have to be in the same order as the predictors in the model.

---

<div class="post-metadata">

**Author:** ![ermeel](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ermeel/32/4180_2.png) [@ermeel](https://discourse.mc-stan.org/u/ermeel)\
**Post date:** [April 2, 2020, 3:02pm UTC](https://discourse.mc-stan.org/t/specifying-different-priors-for-different-coefficients-in-rstanarm/13022/6 "2020-04-02T15:02:16Z")

</div>

Sorry, what you mean by „in the same order as the predictors in the model“? Would this mean that in a model

```
outcome ~ Z + Y + X + (W | ID)

```

I would specify (say) in the location vector the location for Z,Y,X at the 1st, 2nd and 3rd position, respectively?

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [April 2, 2020, 3:41pm UTC](https://discourse.mc-stan.org/t/specifying-different-priors-for-different-coefficients-in-rstanarm/13022/7 "2020-04-02T15:41:25Z")

</div>

Yes
