generalizing to allow for Bernoulli observations