File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ def check(
211
211
212
212
213
213
class BICTerminator (Terminator ):
214
- def __init__ (self , thresh : float = 10 , log : Logger = None ):
214
+ def __init__ (self , thresh : float = 3 , log : Logger = None ):
215
215
super ().__init__ ()
216
216
self .thresh = thresh
217
217
self .log = log or getLogger (self .__class__ .__name__ )
@@ -239,7 +239,10 @@ def compute_val(
239
239
# terminate if the effect sizes have gone in the opposite direction
240
240
self .log .debug ("Terminated b/c effect size did not improve" )
241
241
return True
242
- stat = results .data ["bic" ] - parent_res .bic
242
+ stat = parent_res .bic - results .data ["bic" ]
243
+ # compute the bayes factor approximation from the delta BIC:
244
+ # A practical solution to the pervasive problems of p values
245
+ stat = np .exp (stat / 2 )
243
246
stat = stat [best_idx ]
244
247
else :
245
248
# parent_res = None when the parent node is the root node
@@ -274,6 +277,7 @@ def check(
274
277
else :
275
278
pval , stat = computed_val
276
279
if stat is None :
280
+ # TODO: handle this case by using delta BIC to rank, instead?
277
281
if pval >= self .thresh :
278
282
self .log .debug (
279
283
f"Terminated with delta BIC { stat } and p-value { pval } >= { self .thresh } "
You can’t perform that action at this time.
0 commit comments