@@ -86,13 +86,13 @@ def test_horseshoe_match(srng):
86
86
87
87
88
88
@pytest .mark .parametrize (
89
- "N, p, nonzero_atol " ,
89
+ "N, p, rtol " ,
90
90
[
91
- (50 , 10 , np . array ([ 1.0 , 0.5 , 0.5 , 3e-1 , 3e-1 ]) ),
92
- (50 , 55 , np . array ([ 1.5 , 0.5 , 0.5 , 0.75 , 3e-1 ]) ),
91
+ (50 , 10 , 0.5 ),
92
+ (50 , 75 , 0.5 ),
93
93
],
94
94
)
95
- def test_normal_horseshoe_sampler (srng , N , p , nonzero_atol ):
95
+ def test_normal_horseshoe_sampler (srng , N , p , rtol ):
96
96
"""Check the results of a normal regression model with a Horseshoe prior.
97
97
98
98
This test example is modified from section 3.2 of Makalic & Schmidt (2016)
@@ -131,8 +131,7 @@ def test_normal_horseshoe_sampler(srng, N, p, nonzero_atol):
131
131
assert np .all (lambda_post_val >= 0 )
132
132
133
133
beta_post_median = np .median (beta_post_vals [100 ::2 ], axis = 0 )
134
- assert np .allclose (beta_post_median [:5 ], true_beta [:5 ], atol = nonzero_atol )
135
- assert np .all (np .abs (beta_post_median [5 :]) < 1 )
134
+ assert np .allclose (beta_post_median [:5 ], true_beta [:5 ], atol = 1e-1 , rtol = rtol )
136
135
137
136
138
137
@pytest .mark .parametrize (
0 commit comments