Iterative optimal-bridge estimate of r = c1/c2 (Meng and Wong 1996, eq. 3.5 and Sec. 4), with a common log-shift for overflow safety that cancels exactly.
Examples
set.seed(2)
d1 <- rnorm(400, 0, 1)
d2 <- rnorm(400, 0.5, 1.2)
r <- Bridgs(d1, d2,
log_q1 = function(x) -0.5 * x^2,
log_q2 = function(x) -0.5 * ((x - 0.5) / 1.2)^2)
str(r, max.level = 1)
#> List of 7
#> $ ratio : num 0.801
#> $ log_ratio : num -0.222
#> $ iterations: int 8
#> $ converged : logi TRUE
#> $ n1 : int 400
#> $ n2 : int 400
#> $ method : chr "Meng-Wong iterative optimal bridge (eq. 3.5 / Sec. 4)"
