# Winbugs beta distribution

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?

## 1 Answer

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.