# Multiple distributions sharing the same parameter

**URL:** <https://discourse.mc-stan.org/t/multiple-distributions-sharing-the-same-parameter/31065>\
**Category:** Modeling\
**Tags:** hierarchical-model\
**Created:** [April 13, 2023, 11:11am UTC](https://discourse.mc-stan.org/t/multiple-distributions-sharing-the-same-parameter/31065 "2023-04-13T11:11:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LuckyPal](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/luckypal/32/8116_2.png) [@LuckyPal](https://discourse.mc-stan.org/u/LuckyPal)\
**Post date:** [April 13, 2023, 11:11am UTC](https://discourse.mc-stan.org/t/multiple-distributions-sharing-the-same-parameter/31065/1 "2023-04-13T11:11:14Z")

</div>

Hello,  
I have data with a three-level hierarchy, i.e. `n[j,k]` individuals nested within J populations, nested within K=2 super-populations (let us call them `A` and `B`). Within any population j, the two super-populations may be more or less similar, but I want to estimate the average heterogeneity of the super-populations, i.e. averaged over all J populations. Since I am not specifically interested in the population-specific heterogeneity, I am wondering whether it is required to explicitely estimate it in the first place. As an example:

* * *

The standard way (I guess):

```stan
model {
  for(j in 1:J){
    for(k in 1:K){
      y[j,k] ~ normal(mu[j,k], sigma[j,k]); // individual level
    }
    mu[j,1:K] ~ normal(nu[j], tau[j]); // population-specific heterogeneity expressed by tau[j]
    tau[j] ~ lognormal(tau_mu, tau_sigma); // tau_mu represents average heterogeneity of the super-populations
  }
  tau_mu ~ normal(prior_tau_mu, prior_tau_sigma); // prior for tau_mu 
  tau_sigma ~ gamma(prior_shape, prior_rate); // prior for tau_sigma 
} 

```

* * *

The “short-cut”:

```stan
model {
  for(j in 1:J){
    for(k in 1:K){
      y[j,k] ~ normal(mu[j,k], sigma[j,k]); // individuals
    }
    mu[j,1:K] ~ normal(nu[j], tau); // average heterogeneity expressed by tau
  }
  tau ~ gamma(shape, rate); // prior for tau
} 

```

* * *

So my questions are: What is the difference between the following two models (except that the first model explicitely estimates the population-specific `tau`)? And is the “short-cut” or any of the two models valid?

---

<div class="post-metadata">

**Author:** ![mike-lawrence](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mike-lawrence/32/59_2.png) [@mike-lawrence](https://discourse.mc-stan.org/u/mike-lawrence)\
**Post date:** [April 13, 2023, 12:46pm UTC](https://discourse.mc-stan.org/t/multiple-distributions-sharing-the-same-parameter/31065/2 "2023-04-13T12:46:04Z")

</div>

The first reflects a “partially-pooled” model of the individual taus, while the latter reflects a “fully pooled” model of the individual taus. Generally partially pooling is a good idea, but if there’s only two individual taus, it won’t be dramatically different from fully pooled if the groups associated with each tau are relatively equally informative with respect to its value.
