human_annotations_adu.stan 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. for (g in 1:n_rates) {
  2. real chi_mu = mu_pop[1]*exp(
  3. (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
  4. );
  5. speech_rate_chi[g] ~ gamma(
  6. alpha_child[1],
  7. alpha_child[1]/chi_mu
  8. );
  9. speech_rate_och[g] ~ gamma(
  10. alpha_child[2],
  11. alpha_child[2]/speech_rate_child_och[speech_rate_child[g]]
  12. );
  13. speech_rate_fem[g] ~ gamma(
  14. alpha_child[3],
  15. alpha_child[3]/(speech_rate_child_adu[speech_rate_child[g]]*speech_rate_child_fem_share[speech_rate_child[g]])
  16. );
  17. speech_rate_mal[g] ~ gamma(
  18. alpha_child[4],
  19. alpha_child[4]/(speech_rate_child_adu[speech_rate_child[g]]*(1-speech_rate_child_fem_share[speech_rate_child[g]]))
  20. );
  21. }
  22. speech_rates[:,1] ~ poisson(speech_rate_chi.*durations*1000);
  23. speech_rates[:,2] ~ poisson(speech_rate_och.*durations*1000);
  24. speech_rates[:,3] ~ poisson(speech_rate_fem.*durations*1000);
  25. speech_rates[:,4] ~ poisson(speech_rate_mal.*durations*1000);
  26. for (c in 1:n_speech_rate_children) {
  27. speech_rate_child_fem_share[speech_rate_child_corpus[c]] ~ uniform(0, 1);
  28. int distrib = child_siblings[c]==0?2:1;
  29. speech_rate_child_och[c] ~ gamma(
  30. alpha_corpus_och[distrib],
  31. (alpha_corpus_och[distrib]/(mu_corpus_och[speech_rate_child_corpus[c]]*exp(
  32. speech_rate_child_siblings[c]==0?beta_sib_och:0
  33. )))
  34. );
  35. speech_rate_child_adu[c] ~ gamma(
  36. alpha_corpus_adu[distrib],
  37. (alpha_corpus_adu[distrib]./(mu_corpus_adu[speech_rate_child_corpus[c]]*exp(
  38. speech_rate_child_siblings[c]==0?beta_sib_adu/10.0:0
  39. )))
  40. );
  41. }
  42. child_dev_speech_age ~ normal(0, 1);