Mercurial Hosting > traffic-intelligence
diff python/utils.py @ 511:ad518f0c3218
merged pulling from main
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 28 May 2014 17:46:38 -0400 |
parents | 935430b1d408 0a93afea8243 |
children | 0c86c73f3c09 |
line wrap: on
line diff
--- a/python/utils.py Fri May 23 17:33:11 2014 -0400 +++ b/python/utils.py Wed May 28 17:46:38 2014 -0400 @@ -32,7 +32,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: