@@ -85,15 +85,15 @@ def test_expected_calibration_error(pred_models, true_models, model_names):
8585 out = bf .diagnostics .metrics .expected_calibration_error (pred_models , true_models .transpose )
8686
8787
88- def test_log_gamma (random_estimates , random_targets ):
89- out = bf .diagnostics .metrics .log_gamma (random_estimates , random_targets )
88+ def test_calibration_log_gamma (random_estimates , random_targets ):
89+ out = bf .diagnostics .metrics .calibration_log_gamma (random_estimates , random_targets )
9090 assert list (out .keys ()) == ["values" , "metric_name" , "variable_names" ]
9191 assert out ["values" ].shape == (num_variables (random_estimates ),)
9292 assert out ["metric_name" ] == "Log Gamma"
9393 assert out ["variable_names" ] == ["beta_0" , "beta_1" , "sigma" ]
9494
9595
96- def test_log_gamma_end_to_end ():
96+ def test_calibration_log_gamma_end_to_end ():
9797 # This is a function test for simulation-based calibration.
9898 # First, we sample from a known generative process and then run SBC.
9999 # If the log gamma statistic is correctly implemented, a 95% interval should exclude
@@ -116,11 +116,11 @@ 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 .sbc . gamma_null_distribution (D , S , num_null_draws = 100 )
119+ gamma_null = bf .diagnostics .metrics .gamma_null_distribution (D , S , num_null_draws = 100 )
120120 lower , upper = np .quantile (gamma_null , (0.05 , 0.995 ))
121121
122122 # this is the empirical gamma
123- observed_gamma = bf .diagnostics .metrics .sbc . gamma_discrepancy (ranks , num_post_draws = S )
123+ observed_gamma = bf .diagnostics .metrics .gamma_discrepancy (ranks , num_post_draws = S )
124124
125125 in_interval = lower <= observed_gamma < upper
126126
0 commit comments