Binomial marginal likelihood of the KL calibration's hypothetical results
Source:R/npp_kl_calibration.R
npp_kl_binomial_log_marginals.RdThe KL criterion compares the posterior of the power parameter
under two hypothetical target results. With binomial likelihoods that
posterior is the Beta prior times the marginal likelihood
m(gamma) = Z_T(gamma) / Z_S(gamma) of the binomial power prior (see
binomial_power_prior_log_marginal()), which does not depend on the Beta
prior. It is therefore tabulated once per hypothetical result, on a grid of
power parameters dense near 0 where Beta priors with small shapes put their
quadrature nodes, and interpolated during the optimisation.
The hypothetical results are the expected responder counts of the design: the control arm at the design's control rate, the treatment arm at that rate plus the hypothetical risk difference. The binomial likelihood is defined for fractional counts, as the normal criterion's hypothetical estimate is the expected one.
Usage
npp_kl_binomial_log_marginals(
source_counts,
n_control,
n_treatment,
control_rate,
effects,
n_lattice = 1000L,
n_grid = 801L
)