set.seed(123)
# Setting S = 100 for speed, in practice you would want a much larger sample
# One-sample case
calibrate_posterior_threshold(
p = 0.1,
N = 50,
p0 = 0.1,
S = 100,
theta = c(0.9, 0.95)
)
# Two-sample case
calibrate_posterior_threshold(
p = c(0.1, 0.1),
N = c(50, 50),
p0 = NULL,
delta = 0,
S = 100,
theta = c(0.9, 0.95)
)
Run the code above in your browser using DataLab