# Equivalence of hierarchical models with nested varying intercepts: brms model vs. alternative

The documentation for brms (and lme4) suggests models can include nested varying (“random”) intercepts by adding a grouping term 1|<group> for each level of nesting. For example:

y ~ 1 + (1|k) + (1|k:t)

Assuming a normal likelihood with identity link function, my understanding is that this is equivalent to the following statistical model (with mostly-arbitrary priors):

y_{ikt} \sim N(\mu + \mu_{k} + \mu_{kt}, \sigma_y) \\ \mu = 0 \\ \mu_{kt} \sim N(0,\sigma_{kt}) \\ \mu_k \sim N(0,\sigma_k)\\ \sigma_{kt} \sim N^{+}(0,1)\\ \sigma_{k} \sim N^{+}(0,1)

However, when I think of “nesting,” I think of the lower levels of the varying intercepts coming from a distribution that is a function of higher-level intercepts. In the below example, the distribution of intercepts at the kt level has a mean that varies with the intercept at level k:

y_{ikt} \sim N(\mu + \mu_{kt}, \sigma_y) \\ \mu = 0 \\ \mu_{kt} \sim N(\mu_k, \sigma_{kt})\\ \mu_k \sim N(0,\sigma_k)\\ \sigma_{kt} \sim N^{+}(0,1)\\ \sigma_{k} \sim N^{+}(0,1)

Are these two models equivalent? Perhaps my understanding of what “nested” means is mistaken, but they seem different since the latter seems to shrink kt intercepts toward the k intercepts while the former shrinks both toward 0.

If they aren’t equivalent, how would one specify the latter in brms?