File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
bayesflow/diagnostics/metrics Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ def log_gamma(
5252 - "values" : float or np.ndarray
5353 The log gamma values per variable
5454 - "metric_name" : str
55- The name of the metric ("Log Gamme ").
55+ The name of the metric ("Log Gamma ").
5656 - "variable_names" : str
5757 The (inferred) variable names.
5858 """
@@ -74,13 +74,14 @@ def log_gamma(
7474 null_quantile = np .quantile (null_distribution , quantile )
7575
7676 # compute log gamma for each parameter
77- log_gammas = []
77+ log_gammas = np .empty (ranks .shape [- 1 ])
78+
7879 for i in range (ranks .shape [- 1 ]):
7980 gamma = gamma_discrepancy (ranks [:, i ], num_post_draws = num_post_draws )
80- log_gammas . append ( np .log (gamma / null_quantile ) )
81+ log_gammas [ i ] = np .log (gamma / null_quantile )
8182
8283 output = {
83- "values" : np . array ( log_gammas ) ,
84+ "values" : log_gammas ,
8485 "metric_name" : "Log Gamma" ,
8586 "variable_names" : samples ["estimates" ].variable_names ,
8687 }
You can’t perform that action at this time.
0 commit comments