Skip to content

Commit

Permalink
clipped test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasheinrich committed Jul 30, 2020
1 parent eea9a7e commit e3275ff
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], 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 e3275ff

Please sign in to comment.