def bonferroni(p, axis=-1):
"""Bonferroni correction
Args:
p: array
Array of p-values
Kargs:
axis: int, optional, [def: -1]
Axis to apply the Bonferroni correction. If axis is -1,
the correction is applied through all dimensions.
Return:
Corrected pvalues
"""
if axis == -1:
fact = len(np.ravel(p))
else:
fact = p.shape[axis]
return fact*p
评论列表
文章目录