Stats
- bootstrap_confidence_interval(truth, pred, stat_function, num_iterations=1000, interval=95.0)[source]
Calculate a 95% confidence interval (CI) for a statistic of interest using bootstrap
- Parameters:
- Return type:
- Returns:
95% CI lower bound, value of the statistic, 95% CI upper bound
- pearson_confidence(r, num, interval=0.95)[source]
Calculate upper and lower 95% CI for a Pearson r (not R**2) Inspired by https://stats.stackexchange.com/questions/18887
- max_possible_correlation(vals, error=0.3333333333333333, method=<function pearsonr>, cycles=1000)[source]
Calculate the maximum possible correlation given a particular experimental error Based on Brown, Muchmore, Hajduk http://www.sciencedirect.com/science/article/pii/S1359644609000403 :type vals:
List[float] :param vals: experimental values (should be on a log scale) :type error:float:param error: experimental error :type method:Callable[[List[float],List[float]],float] :param method: method for calculating the correlation, must take 2 lists and return correlation and p_value :type cycles:int:param cycles: number of random cycles :rtype:float:return: maximum possible correlation