def obrien_fleming(information_fraction, alpha=0.05):
"""
Calculate an approximation of the O'Brien-Fleming alpha spending function.
Args:
information_fraction (scalar or array_like): share of the information
amount at the point of evaluation, e.g. the share of the maximum
sample size
alpha: type-I error rate
Returns:
float: redistributed alpha value at the time point with the given
information fraction
"""
return (1 - norm.cdf(norm.ppf(1 - alpha / 2) / np.sqrt(information_fraction))) * 2
评论列表
文章目录