|
@@ -8,7 +8,7 @@ real confusion_model_lpdf(array[] matrix lambda,
|
|
|
array[] real age,
|
|
|
array[] real clip_duration,
|
|
|
matrix p,
|
|
|
- matrix eta_voc
|
|
|
+ real eta_voc
|
|
|
) {
|
|
|
real ll = 0;
|
|
|
vector [4] dp;
|
|
@@ -31,7 +31,7 @@ real confusion_model_lpdf(array[] matrix lambda,
|
|
|
|
|
|
// chi_d is the latent amount of CHI vocalizations detected as i
|
|
|
for (chi_d in 0:(truth[k,1]>0?min(truth[k,1], algo[k,i]):0)) {
|
|
|
- dp[1] = truth[k,1]==0?0:beta_binomial_lpmf(chi_d | truth[k,1], lambda[lg,1,i]*eta_voc[1,i], (1-lambda[lg,1,i])*eta_voc[1,i]);
|
|
|
+ dp[1] = truth[k,1]==0?0:beta_binomial_lpmf(chi_d | truth[k,1], lambda[lg,1,i]*eta_voc, (1-lambda[lg,1,i])*eta_voc);
|
|
|
// chi1 is the amount of those vocalizations that result in only one voc i
|
|
|
// (as opposed to two vocs)
|
|
|
for (chi1 in max(0, 2*chi_d-algo[k,i]):chi_d) {
|
|
@@ -39,19 +39,19 @@ real confusion_model_lpdf(array[] matrix lambda,
|
|
|
bp[1] = chi_d==0?0:binomial_lpmf(chi1 | chi_d, p[1,i]);
|
|
|
|
|
|
for (och_d in 0:(truth[k,2]>0?min(truth[k,2], algo[k,i]-chi):0)) {
|
|
|
- dp[2] = truth[k,2]==0?0:beta_binomial_lpmf(och_d | truth[k,2], lambda[lg,2,i]*eta_voc[2,i], (1-lambda[lg,2,i])*eta_voc[2,i]);
|
|
|
+ dp[2] = truth[k,2]==0?0:beta_binomial_lpmf(och_d | truth[k,2], lambda[lg,2,i]*eta_voc, (1-lambda[lg,2,i])*eta_voc);
|
|
|
for (och1 in max(0, 2*och_d-(algo[k,i]-chi)):och_d) {
|
|
|
int och = 2*och_d-och1;
|
|
|
bp[2] = och_d==0?0:binomial_lpmf(och1 | och_d, p[2,i]);
|
|
|
|
|
|
for (fem_d in 0:(truth[k,3]>0?min(truth[k,3], algo[k,i]-chi-och):0)) {
|
|
|
- dp[3] = truth[k,3]==0?0:beta_binomial_lpmf(fem_d | truth[k,3], lambda[lg,3,i]*eta_voc[3,i], (1-lambda[lg,3,i])*eta_voc[3,i]);
|
|
|
+ dp[3] = truth[k,3]==0?0:beta_binomial_lpmf(fem_d | truth[k,3], lambda[lg,3,i]*eta_voc, (1-lambda[lg,3,i])*eta_voc);
|
|
|
for (fem1 in max(0, 2*fem_d-(algo[k,i]-chi-och)):fem_d) {
|
|
|
int fem = 2*fem_d-fem1;
|
|
|
bp[3] = fem_d==0?0:binomial_lpmf(fem1 | fem_d, p[3,i]);
|
|
|
|
|
|
for (mal_d in 0:(truth[k,4]>0?min(truth[k,4], algo[k,i]-chi-och-fem):0)) {
|
|
|
- dp[4] = truth[k,4]==0?0:beta_binomial_lpmf(mal_d | truth[k,4], lambda[lg,4,i]*eta_voc[4,i], (1-lambda[lg,4,i])*eta_voc[4,i]);
|
|
|
+ dp[4] = truth[k,4]==0?0:beta_binomial_lpmf(mal_d | truth[k,4], lambda[lg,4,i]*eta_voc, (1-lambda[lg,4,i])*eta_voc);
|
|
|
for (mal1 in max(0, 2*mal_d-(algo[k,i]-chi-och-fem)):mal_d) {
|
|
|
int mal = 2*mal_d-mal1;
|
|
|
int delta = algo[k,i] - (mal+fem+och+chi);
|