# Why does horseshoe prior for a linear model need a non-linear formula

**URL:** <https://discourse.mc-stan.org/t/why-does-horseshoe-prior-for-a-linear-model-need-a-non-linear-formula/25438>\
**Category:** brms\
**Created:** [November 25, 2021, 5:07pm UTC](https://discourse.mc-stan.org/t/why-does-horseshoe-prior-for-a-linear-model-need-a-non-linear-formula/25438 "2021-11-25T17:07:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lauri](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@lauri](https://discourse.mc-stan.org/u/lauri)\
**Post date:** [November 26, 2021, 2:12pm UTC](https://discourse.mc-stan.org/t/why-does-horseshoe-prior-for-a-linear-model-need-a-non-linear-formula/25438/3 "2021-11-26T14:12:57Z")

</div>

Thank you AWoodward for your reply. What you suggest is exactly what I wanted to do in the first place. There is nothing about the system that is non-linear and that’s the confusion I have. I don’t want to model any non-linear effects here. That formula is based on an earlier reply here: [prior on subset of predictors](https://discourse.mc-stan.org/t/horseshoe-prior-on-subset-of-predictors/8140)

When I try test case:

```

formula <- bf(sns_theta ~ 1 + PVA + NVEA + PPhysA + age)
priors <- c(prior(horseshoe(1), class = "b", coef = PVA),
            prior(horseshoe(1), class = "b", coef = NVEA),
            prior(horseshoe(1), class = "b", coef = PPhysA),
            prior(normal(0, 1), class = "b", coef = age))

# fit 
horsehoe_fit <- brm(formula = formula, data = surveys, family = gaussian(),
                    prior = priors, iter = 3000, warmup = 1000, chains = 4, cores = 4,
                    control = list(adapt_delta = 0.999, max_treedepth = 15))

```

I get the following message: Error: Prior ‘horseshoe(1)’, ‘horseshoe(1)’, ‘horseshoe(1)’ is used in an invalid context. See ?set\_prior for details on how to use special priors.

So I am wondering that even if I am using the brms non-linear syntax it in fact is just a linear model since I have not specified any non-linear effects.

Thanks again for taking the time to reply.

---

_[View the full topic](https://discourse.mc-stan.org/t/why-does-horseshoe-prior-for-a-linear-model-need-a-non-linear-formula/25438)._
