From dee3085f56a2aeb2c6870b3ea8ca263ed0892e1d Mon Sep 17 00:00:00 2001 From: Yakov Date: Thu, 21 Mar 2024 09:30:38 +0000 Subject: [PATCH] fix: small fixes in susie defaults (#552) --- src/gentropy/method/susie_inf.py | 4 ++-- tests/gentropy/method/test_susie_inf.py | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/gentropy/method/susie_inf.py b/src/gentropy/method/susie_inf.py index d493285a0..522f77193 100644 --- a/src/gentropy/method/susie_inf.py +++ b/src/gentropy/method/susie_inf.py @@ -34,7 +34,7 @@ def susie_inf( # noqa: C901 ssq_range: tuple[float, float] = (0, 1), pi0: np.ndarray | None = None, est_sigmasq: bool = True, - est_tausq: bool = True, + est_tausq: bool = False, sigmasq: float = 1, tausq: float = 0, sigmasq_range: tuple[float, float] | None = None, @@ -399,7 +399,7 @@ def g(x: float) -> float: def cred_inf( PIP: np.ndarray, n: int = 100_000, - coverage: float = 0.9, + coverage: float = 0.99, purity: float = 0.5, LD: np.ndarray | None = None, V: np.ndarray | None = None, diff --git a/tests/gentropy/method/test_susie_inf.py b/tests/gentropy/method/test_susie_inf.py index d8e855a5b..b671bf274 100644 --- a/tests/gentropy/method/test_susie_inf.py +++ b/tests/gentropy/method/test_susie_inf.py @@ -16,7 +16,7 @@ def test_SUSIE_inf_lbf_moments( ld = sample_data_for_susie_inf[0] z = sample_data_for_susie_inf[1] lbf_moments = sample_data_for_susie_inf[2] - susie_output = SUSIE_inf.susie_inf(z=z, LD=ld, method="moments") + susie_output = SUSIE_inf.susie_inf(z=z, LD=ld, est_tausq=True, method="moments") lbf_calc = susie_output["lbf_variable"][:, 0] assert np.allclose( lbf_calc, lbf_moments @@ -29,7 +29,7 @@ def test_SUSIE_inf_lbf_mle( ld = sample_data_for_susie_inf[0] z = sample_data_for_susie_inf[1] lbf_mle = sample_data_for_susie_inf[3] - susie_output = SUSIE_inf.susie_inf(z=z, LD=ld, method="MLE") + susie_output = SUSIE_inf.susie_inf(z=z, LD=ld, est_tausq=True, method="MLE") lbf_calc = susie_output["lbf_variable"][:, 0] assert np.allclose( lbf_calc, lbf_mle, atol=1e-1 @@ -41,6 +41,10 @@ def test_SUSIE_inf_cred( """Test of SuSiE-inf credible set generator.""" ld = sample_data_for_susie_inf[0] z = sample_data_for_susie_inf[1] - susie_output = SUSIE_inf.susie_inf(z=z, LD=ld) + susie_output = SUSIE_inf.susie_inf( + z=z, + LD=ld, + est_tausq=True, + ) cred = SUSIE_inf.cred_inf(susie_output["PIP"], LD=ld) assert cred[0] == [5]