|
@@ -18,13 +18,13 @@ for (c in 1:n_children) {
|
|
|
|
|
|
mu_child_level[c,1] ~ gamma(
|
|
|
alpha_pop_level[distrib,1],
|
|
|
- (alpha_pop_level[distrib,1]/(mu_pop_level[2,corpus[c]]*exp(
|
|
|
+ (alpha_pop_level[distrib,1]/(mu_pop_level[2]*exp(
|
|
|
child_siblings[c]==0?beta_sib_och:0
|
|
|
)))
|
|
|
);
|
|
|
mu_child_level[c,2:] ~ gamma(
|
|
|
alpha_pop_level[distrib,2:],
|
|
|
- (alpha_pop_level[distrib,2:]./(mu_pop_level[3:,corpus[c]]*exp(
|
|
|
+ (alpha_pop_level[distrib,2:]./(mu_pop_level[3:]*exp(
|
|
|
child_siblings[c]==0?beta_sib_adu/10.0:0
|
|
|
)))
|
|
|
);
|
|
@@ -33,24 +33,24 @@ for (c in 1:n_children) {
|
|
|
else {
|
|
|
// assuming no sibling
|
|
|
ll[1] = log(1-p_sib)+gamma_lpdf(
|
|
|
- mu_child_level[c,1] | alpha_pop_level[2,1], alpha_pop_level[2,2]/(mu_pop_level[2,corpus[c]]*exp(beta_sib_och))
|
|
|
+ mu_child_level[c,1] | alpha_pop_level[2,1], alpha_pop_level[2,2]/(mu_pop_level[2]*exp(beta_sib_och))
|
|
|
);
|
|
|
ll[1] += gamma_lpdf(
|
|
|
- mu_child_level[c,2] | alpha_pop_level[2,2], alpha_pop_level[2,3]/(mu_pop_level[3,corpus[c]]*exp(beta_sib_adu/10.0))
|
|
|
+ mu_child_level[c,2] | alpha_pop_level[2,2], alpha_pop_level[2,3]/(mu_pop_level[3]*exp(beta_sib_adu/10.0))
|
|
|
);
|
|
|
ll[1] += gamma_lpdf(
|
|
|
- mu_child_level[c,3] | alpha_pop_level[2,3], alpha_pop_level[2,4]/(mu_pop_level[4,corpus[c]]*exp(beta_sib_adu/10.0))
|
|
|
+ mu_child_level[c,3] | alpha_pop_level[2,3], alpha_pop_level[2,4]/(mu_pop_level[4]*exp(beta_sib_adu/10.0))
|
|
|
);
|
|
|
|
|
|
// assuming sibling
|
|
|
ll[2] = log(p_sib)+gamma_lpdf(
|
|
|
- mu_child_level[c,1] | alpha_pop_level[1,1], alpha_pop_level[1,2]/(mu_pop_level[2,corpus[c]])
|
|
|
+ mu_child_level[c,1] | alpha_pop_level[1,1], alpha_pop_level[1,2]/(mu_pop_level[2])
|
|
|
);
|
|
|
ll[2] += gamma_lpdf(
|
|
|
- mu_child_level[c,2] | alpha_pop_level[1,2], alpha_pop_level[1,3]/(mu_pop_level[3,corpus[c]])
|
|
|
+ mu_child_level[c,2] | alpha_pop_level[1,2], alpha_pop_level[1,3]/(mu_pop_level[3])
|
|
|
);
|
|
|
ll[2] += gamma_lpdf(
|
|
|
- mu_child_level[c,3] | alpha_pop_level[1,3], alpha_pop_level[1,4]/(mu_pop_level[4,corpus[c]])
|
|
|
+ mu_child_level[c,3] | alpha_pop_level[1,3], alpha_pop_level[1,4]/(mu_pop_level[4])
|
|
|
);
|
|
|
target += log_sum_exp(ll);
|
|
|
}
|