Yes, w(x) needs to be a probability, but they don’t need (should not) to sum to 1.0.
The assumption applied here is that when the p-value was smaller than 0.05, all the experiments will be published (that is to say the probability of publishing here is 100%, i.e., w[2]
). When one experiment’s p-value was larger than 0.05, the probability of publishing was a fixed probability, which should be smaller than 100% w[1]
. Their sum is not 1. Hope it makes sense.
I guess the probabilities that one experiment’s p-value was larger or smaller than 0.05 sum to 1.0, but it is not w(x) here.
Just another update. It seems that I found the bug in the original code:
...
// (bias-related)
target += normal_lpdf(Y[n] | mu[n], se[n]);
target += log(omega[I[n]]);
// denominators
target += - log_sum_exp(
normal_lcdf(1.96 * se[n] | mu[n], se[n]) + log(omega[1]),
normal_lccdf(1.96 * se[n] | mu[n], se[n]) + log(omega[2])
);
...
Once I use 1.96 * se[n]
(instead of 1.96
; I used the wrong value to calculate the CDF), the model can converge now. The results are similar to my last answer. I’m not sure if I fully understand the differences, but it seems that they are equivalent (this and the last answer).