From 850be29d20be07f5afab5613ab0154c9cc027a98 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Tue, 6 Dec 2022 17:18:16 +0000 Subject: [PATCH] tests: test for Hotelling t-squared p-value added. --- tests/fits_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/fits_test.py b/tests/fits_test.py index 41d876c7..828c0cbe 100644 --- a/tests/fits_test.py +++ b/tests/fits_test.py @@ -214,6 +214,15 @@ def test_correlated_fit(): assert(diff.is_zero_within_error(sigma=5)) +def test_hotelling_t(): + tt1 = pe.Obs([np.random.rand(50)], ["ens"]) + tt1.gamma_method() + tt2 = pe.Obs([np.random.rand(50)], ["ens"]) + tt2.gamma_method() + ft = pe.fits.least_squares([1, 2], [tt1, tt2], lambda a, x: a[0], correlated_fit=True) + assert ft.t2_p_value >= ft.p_value + + def test_fit_corr_independent(): dim = 30 x = np.arange(dim)