Data come from with known . Test against with . Use and find quantiles numerically to at least ; do not use scipy.
log_likelihood_ratio(x, mu0, mu1, sigma): .lrt_threshold(alpha, mu0, sigma, N): the critical value such that rejecting when has type I error rate .type2_error(x_star, mu1, sigma, N): .power(mu1, mu0, sigma, N, alpha): for the size- test.empirical_rates(mu0, mu1, sigma, N, alpha, n_rep, seed): with rng = np.random.default_rng(seed), draw n_rep datasets under as mu0 + sigma * rng.standard_normal((n_rep, N)), then n_rep under the same way with mu1. Apply the size- test to each and return (type1_rate, power): the rejection fraction under and under .p_h0_given_significant(alpha, power, prior_h0): by Bayes' rule.Return floats.