Mercurial Hosting > traffic-intelligence
changeset 500:3b99d712bbee
merged
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 09 May 2014 14:09:14 -0400 |
parents | 0a93afea8243 (diff) ef4059f51af9 (current diff) |
children | c81cbd6953fb |
files | |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
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: