@@ -116,8 +116,8 @@ def run_sbc(N=N, S=S, D=D, bias=0):
116116 ranks = np .sum (posterior_draws < prior_draws , axis = 0 )
117117
118118 # this is the distribution of gamma under uniform ranks
119- gamma_null = bf .diagnostics .metrics .gamma_null_distribution (D , S , num_null_draws = 100 )
120- lower , upper = np .quantile (gamma_null , (0.05 , 0.995 ))
119+ gamma_null = bf .diagnostics .metrics .gamma_null_distribution (D , S , num_null_draws = 200 )
120+ lower , upper = np .quantile (gamma_null , (0.025 , 0.975 ))
121121
122122 # this is the empirical gamma
123123 observed_gamma = bf .diagnostics .metrics .gamma_discrepancy (ranks , num_post_draws = S )
@@ -127,7 +127,7 @@ def run_sbc(N=N, S=S, D=D, bias=0):
127127 return in_interval
128128
129129 sbc_calibration = [run_sbc (N = N , S = S , D = D ) for _ in range (100 )]
130- lower_expected , upper_expected = binom .ppf ((0.0005 , 0.9995 ), 100 , 0.95 )
130+ lower_expected , upper_expected = binom .ppf ((0.0001 , 0.9999 ), 100 , 0.95 )
131131
132132 # this test should fail with a probability of 0.1%
133133 assert lower_expected <= np .sum (sbc_calibration ) <= upper_expected
0 commit comments