Mercurial > hg > nsaunier > traffic-intelligence
comparison python/utils.py @ 687:de278c5e65f6 dev
minor comments for lognormal parameters (numpy and usual names differ)
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 22 Jun 2015 15:27:33 +0200 |
| parents | cdee6a3a47b4 |
| children | 9990ef119bce |
comparison
equal
deleted
inserted
replaced
| 686:cdee6a3a47b4 | 687:de278c5e65f6 |
|---|---|
| 25 ######################### | 25 ######################### |
| 26 # Simple statistics | 26 # Simple statistics |
| 27 ######################### | 27 ######################### |
| 28 | 28 |
| 29 def logNormalMeanVar(loc, scale): | 29 def logNormalMeanVar(loc, scale): |
| 30 '''location and scale are respectively the mean and standard deviation of the normal in the log-normal distribution | |
| 31 https://en.wikipedia.org/wiki/Log-normal_distribution''' | |
| 30 mean = exp(loc+(scale**2)/2) | 32 mean = exp(loc+(scale**2)/2) |
| 31 var = (exp(loc**2)-1)*exp(2*loc+scale**2) | 33 var = (exp(loc**2)-1)*exp(2*loc+scale**2) |
| 32 return mean, var | 34 return mean, var |
| 33 | 35 |
| 34 def sampleSize(stdev, tolerance, percentConfidence, printLatex = False): | 36 def sampleSize(stdev, tolerance, percentConfidence, printLatex = False): |
