# Question about sigma default prior location

**URL:** <https://discourse.mc-stan.org/t/question-about-sigma-default-prior-location/19728>\
**Category:** brms\
**Tags:** priors, brms\
**Created:** [December 10, 2020, 11:06am UTC](https://discourse.mc-stan.org/t/question-about-sigma-default-prior-location/19728 "2020-12-10T11:06:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![willemsleegers](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/willemsleegers/32/10107_2.png) [@willemsleegers](https://discourse.mc-stan.org/u/willemsleegers)\
**Post date:** [December 10, 2020, 11:06am UTC](https://discourse.mc-stan.org/t/question-about-sigma-default-prior-location/19728/1 "2020-12-10T11:06:07Z")

</div>

I have a (probably silly) question about the default sigma prior that brms uses.

It is my understanding that the default sigma prior is a half student t distribution with 3 degrees of freedom, a location of 0, and a scale given by max(2.5, mad(y)).

However, if I sample from the prior after running the model, I don’t see that the location of the prior on sigma is 0. Instead, it seems to be shifted to the right. How does this work exactly? Is this due to the fact it is a half student-t distribution?

Below I put some code to show the prior sigma distribution after running the model.

```
library(tidyverse)
library(brms)

set.seed(1)

data <- tibble(y = rnorm(100))

model <- bf(y ~ 1)

get_prior(model, data)
# default df of 3, default location of 0, default scale of max(2.5, mad(y))

fit <- brm(formula = y ~ 1, data = data, sample_prior = TRUE)

prior_samples(fit, ) %>%
  ggplot(aes(x = sigma)) + geom_density()

```

- Operating System: macOS Big Sur 11.0.1 (20B29)
- brms Version: 2.14.4

---

<div class="post-metadata">

**Author:** ![hhau](https://avatars.discourse-cdn.com/v4/letter/h/2bfe46/32.png) [@hhau](https://discourse.mc-stan.org/u/hhau)\
**Post date:** [December 10, 2020, 11:28am UTC](https://discourse.mc-stan.org/t/question-about-sigma-default-prior-location/19728/2 "2020-12-10T11:28:21Z")

</div>

It’s just an artefact of the kernel density estimate used by `geom_density`. Try:

```
fit <- brm(formula = y ~ 1, data = data, sample_prior = TRUE, iter = 5e5, cores = 4)

prior_samples(fit, ) %>%
  ggplot(aes(x = sigma)) + 
  geom_histogram(bins = 500) +
  scale_x_continuous(limits = c(0, 5))

```

---

<div class="post-metadata">

**Author:** ![willemsleegers](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/willemsleegers/32/10107_2.png) [@willemsleegers](https://discourse.mc-stan.org/u/willemsleegers)\
**Post date:** [December 10, 2020, 11:58am UTC](https://discourse.mc-stan.org/t/question-about-sigma-default-prior-location/19728/3 "2020-12-10T11:58:57Z")

</div>

Ah, that clears it up; thanks!
