Apologies. Won’t happen again .
Hi @Ole_Rogeberg, thank you very much for your reply. To me this seems to be a truncated distribution problem, for which the model I am doing should theoretically correct for it, at the cost of assuming the process of truncation.
I am still not super sure I understand why the normalization constant should be study specific, that is not the case for a truncation process, in which you correct the whole likelihood. Moreover, looking at your paper, in the model section you also model the likelihood with a reweighting scheme and normalize by an overall constant, so I am slightly confused.
Would you be willing to share your updated code, so I can compare it to the old one?
I am also a bit confused by the role of
type_pub_prob[i] = softmax(temp_prob_raw[, i]);
since you never use it again in the model. If I understand correctly your model, in this section
model {
global_mu ~ normal(0, 1);
mu_sigma ~ normal(0,1);
rel_obsprob ~ gamma(1, 2);
//model
for (i in 1:N){
real temp_norm;
real temp_sd_both = sqrt(se[i]^2 + mu_sigma^2);
temp_norm = log_sum_exp(temp_prob_raw);
// Probability of observing a study with the observed type given the standard error
if (results_type[i] == 1){
target += log_rel_obsprob[1] + normal_lpdf(y[i] | global_mu, temp_sd_both) - temp_norm;
} else if (results_type[i] == 2){
target += log_rel_obsprob[2] + normal_lpdf(y[i] | global_mu, temp_sd_both) - temp_norm;
} else {
target += normal_lpdf(y[i] | global_mu, temp_sd_both) - temp_norm;
}
}
}
This part temp_norm = log_sum_exp(temp_prob_raw)
, should actually be temp_norm = log_sum_exp(type_pub_prob)
, am I correct in thinking that?
No worries, and thanks for being understanding.