I am trying to compute this rear distribution in R. The problem is that the numerator, which is the product of the dbern (p_i, y_i) 1 heap, is too small. (My n about 1500). Consequently, R splashes out 0, and the back values for all \ theta are also 0.
To clarify, each y_i has its own p_i, together these p_i create a vector of n elements for n y. Each theta has its own n-element vector p_i.

Reproducible Example (Numerator)
p <- sample(seq(0.001,0.999,by=0.01), 1500, replace=T)
y <- sample(c(0,1), 1500, replace=T)
dbern(y, p)
prod(dbern(y, p))
exp(sum(log(dbern(y, p))))
EDIT (): (jstor.org/stable/25791783 - Western Kleykamp 2004). y , y , Albert and Chib (1993). y , p = cdf-normal (x'B).
, p theta? , . - - , , theta = 10, = 1 10- = 0 10- .
, p x, x theta - , p theta.
, .