# HG changeset patch # User Nicolas Saunier # Date 1399658954 14400 # Node ID 3b99d712bbee243b5a9a90283ac5863b7a02ba4e # Parent 0a93afea8243123b3bacec499b59b421ec3017f5# Parent ef4059f51af9189b4681883506874ddbdabaa137 merged diff -r ef4059f51af9 -r 3b99d712bbee python/utils.py --- a/python/utils.py Mon May 05 23:17:46 2014 -0400 +++ b/python/utils.py Fri May 09 14:09:14 2014 -0400 @@ -36,7 +36,12 @@ return (k*stdev/tolerance)**2 def confidenceInterval(mean, stdev, nSamples, percentConfidence, trueStd = True, printLatex = False): - 'if trueStd, use normal distribution, otherwise, Student' + '''if trueStd, use normal distribution, otherwise, Student + + Use otherwise t.interval or norm.interval + ex: norm.interval(0.95, loc = 0., scale = 2.3/sqrt(11)) + t.interval(0.95, 10, loc=1.2, scale = 2.3/sqrt(nSamples)) + loc is mean, scale is sigma/sqrt(n) (for Student, 10 is df)''' from math import sqrt from scipy.stats.distributions import norm, t if trueStd: