The likelihood product is too small - R gives only 0

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.

enter image description here

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) # 1500-element vector, each element < 1
prod(dbern(y, p)) # produces 0
exp(sum(log(dbern(y, p)))) # produces 0

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.

, .

+5
3

Cross Validated, glen_b () :


; , , - , .

:

1: "" θ, θ0. θ = θ0, -, .

2: , , exp , exp .

NB: - p 0 1, ; , !

, .

, , .

, .

+1

, , - -. , .

, , : , argmax.

+5

, , ( ) 0, 0

p <- sample(seq(0,1,by=0.01), 1500, replace=T)
y <- sample(c(0,1), replace=T)
x <- dbern(y, p)
any(x == 0)
## [1] TRUE
+3

All Articles