Skip to content

Commit

Permalink
clipped test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasheinrich authored and matthewfeickert committed Aug 15, 2020
1 parent f82f5b0 commit f3aaad9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,30 @@ def logpdf(self, pars, data):
assert np.isclose(cls, 0.7267836451638846)


def test_clipped_normal_calc(hypotest_args):
mu_test, data, pdf = hypotest_args
_, exp1 = pyhf.infer.hypotest(
0.2,
data,
pdf,
calc_kwargs={'base_distr': 'clipped_normal'},
return_expected_set=True,
)
_, exp2 = pyhf.infer.hypotest(
0.2, data, pdf, calc_kwargs={'base_distr': 'normal'}, return_expected_set=True
)
assert exp1[-1] < exp2[-1]

with pytest.raises(ValueError):
_, exp2 = pyhf.infer.hypotest(
0.2,
data,
pdf,
calc_kwargs={'base_distr': 'unknown'},
return_expected_set=True,
)


@pytest.mark.parametrize("qtilde", [True, False])
def test_calculator_distributions_without_teststatistic(qtilde):
calc = pyhf.infer.AsymptoticCalculator(
Expand Down

0 comments on commit f3aaad9

Please sign in to comment.