Skip to contents

Compute the closed-form two-arm CMR allocation for a supplied confidence rectangle over treatment and control variances.

Usage

binary_rectangle_corners(rectangle)

binary_rectangle_regret(pi, rectangle, return_details = FALSE)

cmr_two_arm_from_rectangle(rectangle)

cmr_binary_from_rectangle(rectangle)

Arguments

rectangle

Two-arm variance rectangle, either a numeric vector with names v_l1, v_u1, v_l0, v_u0 or a compatible rectangle object.

pi

Treatment assignment share.

return_details

If TRUE, return corner regrets and binding-corner information instead of only the maximum regret.

Value

cmr_two_arm_from_rectangle() returns a list of class cmr_two_arm with pi, U_CMR, the input rectangle, rectangle corners, corner regrets, binding-corner diagnostics, and additional solver diagnostics. binary_rectangle_corners() returns the two least-favorable rectangle corners. binary_rectangle_regret() returns the worst regret at pi, or a detailed list when return_details = TRUE.

Examples

rect <- c(v_l1 = 0.02, v_u1 = 0.12, v_l0 = 0.01, v_u0 = 0.08)
fit <- cmr_two_arm_from_rectangle(rect)
fit$pi
#> [1] 0.5602917
fit$U_CMR
#> [1] 0.03763448
binary_rectangle_regret(0.5, rect)
#> [1] 0.06071797