123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- for (g in 1:n_rates) {
- real chi_mu = mu_pop[1]*exp(
- (alpha_dev+sigma_dev*child_dev_speech_age[speech_rate_child[g]])*speech_rate_age[g]/12.0/10.0 + beta_dev*(speech_rate_child_adu[speech_rate_child[g]]-mu_pop[2])*speech_rate_age[g]/12.0/10.0
- );
- speech_rate_chi[g] ~ gamma(
- alpha_child[1],
- alpha_child[1]/chi_mu
- );
- speech_rate_och[g] ~ gamma(
- alpha_child[2],
- alpha_child[2]/speech_rate_child_och[speech_rate_child[g]]
- );
- speech_rate_fem[g] ~ gamma(
- alpha_child[3],
- alpha_child[3]/(speech_rate_child_adu[speech_rate_child[g]]*speech_rate_child_fem_share[speech_rate_child[g]])
- );
- speech_rate_mal[g] ~ gamma(
- alpha_child[4],
- alpha_child[4]/(speech_rate_child_adu[speech_rate_child[g]]*(1-speech_rate_child_fem_share[speech_rate_child[g]]))
- );
- }
- speech_rates[:,1] ~ poisson(speech_rate_chi.*durations*1000);
- speech_rates[:,2] ~ poisson(speech_rate_och.*durations*1000);
- speech_rates[:,3] ~ poisson(speech_rate_fem.*durations*1000);
- speech_rates[:,4] ~ poisson(speech_rate_mal.*durations*1000);
- for (c in 1:n_speech_rate_children) {
- speech_rate_child_fem_share[speech_rate_child_corpus[c]] ~ uniform(0, 1);
- int distrib = child_siblings[c]==0?2:1;
- speech_rate_child_och[c] ~ gamma(
- alpha_corpus_och[distrib],
- (alpha_corpus_och[distrib]/(mu_corpus_och[speech_rate_child_corpus[c]]*exp(
- speech_rate_child_siblings[c]==0?beta_sib_och:0
- )))
- );
- speech_rate_child_adu[c] ~ gamma(
- alpha_corpus_adu[distrib],
- (alpha_corpus_adu[distrib]./(mu_corpus_adu[speech_rate_child_corpus[c]]*exp(
- speech_rate_child_siblings[c]==0?beta_sib_adu/10.0:0
- )))
- );
- }
- child_dev_speech_age ~ normal(0, 1);
|