I have fitted a likelihood function with a dbeta function in WinBUGs as follows

# likelihood
for(i in 1:n){
  FC[i] ~ dbeta(a[TREATMENT[i]], b[TREATMENT[i]]) 

FC is an R array with values between 1 and 0 (1 and 0 included). However, my model throws an error and does not work as it seems I cannot include 1s or 0s.

I heard that the Beta distribution works for data 0..1.

Any idea what is going on?


Beta is a distribution bounded in $[0, 1]$, or $(0, 1)$, depending on it's definition. Notice however that since it is continuous, probability of seeing exact $0$ or $1$ is zero. Moreover, log-likelihood for $0$ and $1$ is undefined and I guess this is the reason why the bounds are not included in Winbugs, since it needs to evaluate the log-likelihood.

See also Why exactly can't beta regression deal with 0s and 1s in the response variable?, and Beta regression of proportion data including 1 and 0, and Dealing with 0,1 values in a beta regression.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.