Mercurial Hosting > traffic-intelligence
diff python/utils.py @ 680:da1352b89d02 dev
classification is working
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 05 Jun 2015 02:25:30 +0200 |
parents | ae07c7b4cf87 |
children | cdee6a3a47b4 |
line wrap: on
line diff
--- a/python/utils.py Wed Jun 03 16:00:46 2015 +0200 +++ b/python/utils.py Fri Jun 05 02:25:30 2015 +0200 @@ -26,6 +26,11 @@ # Simple statistics ######################### +def logNormalMeanVar(loc, scale): + mean = exp(loc+(scale**2)/2) + var = (exp(loc**2)-1)*exp(2*loc+scale**2) + return mean, var + def sampleSize(stdev, tolerance, percentConfidence, printLatex = False): from scipy.stats.distributions import norm k = round(norm.ppf(0.5+percentConfidence/200., 0, 1)*100)/100. # 1.-(100-percentConfidence)/200.