The Bernoulli probability mass function

for (i in 1:100){
total[i] = inv_logit(b_0 + b_titer*(loglower_trans_1[n]+(i*diff_logtiter[n])/100));
y_step[i] = bernoulli_pmf(infection[n] | total[i]);


I would like bernoulli_pmf, but seems there is no this function, I only could get bernoulli_lpmf…but I don’t need log at this step

Hi @Qian_Xiong, from the snippet of code that you pasted I cannot figure out what you’re trying to do exactly. The assignment y_step[i] = bernoulli_pmf(...); does not make sense to me. Is y_step a data object or a parameter? Can you explain what you’re trying to accomplish?

Hi @MauritsM, thanks so much for your help, I found a proper way to solve my problem now. what I wanted is a pmf for a bernoulli distribution, but there is no such function, now I solved it.

1 Like