[or-cvs] r20652: {torflow} Make everything slightly more informative. (torflow/trunk/CircuitAnalysis/BuildTimes)

mikeperry at seul.org mikeperry at seul.org
Wed Sep 23 01:27:05 UTC 2009


Author: mikeperry
Date: 2009-09-22 21:27:05 -0400 (Tue, 22 Sep 2009)
New Revision: 20652

Modified:
   torflow/trunk/CircuitAnalysis/BuildTimes/pareto.py
Log:

Make everything slightly more informative.



Modified: torflow/trunk/CircuitAnalysis/BuildTimes/pareto.py
===================================================================
--- torflow/trunk/CircuitAnalysis/BuildTimes/pareto.py	2009-09-23 01:15:20 UTC (rev 20651)
+++ torflow/trunk/CircuitAnalysis/BuildTimes/pareto.py	2009-09-23 01:27:05 UTC (rev 20652)
@@ -8,23 +8,35 @@
 # Note that alpha is not the only potential source of estimate error though.
 # With insufficient samples we may not have a valid value for Xm either.
 # I'm uncertain at this point on how to account for this or bound this error.
+#
+# One other thing to note is the possible interplay with the CDF point
+# and the values from binomial.py
 import math
 
 def CalculateTimeout(Xm, alpha, q):
   return (Xm/math.pow(1.0-q,1.0/alpha))/1000.0;
 
-sample_sizes = [100, 150, 200, 250, 300, 350, 400, 500, 600, 800, 1000]
+def ParetoF(Xm, alpha, timeout):
+  return math.pow(Xm/timeout, alpha)
 
+sample_sizes = [50, 100, 250, 500, 1000, 2500, 5000]
+
 def dump_table(Xm, alpha):
   for n in sample_sizes:
     sigma = alpha/math.sqrt(n)
-    print "Timeouts for Xm: "+str(Xm)+", alpha: "+str(alpha)+" n:"+str(n)+" sigma: "+str(sigma)
-    print "\t -2*sigma: "+str(CalculateTimeout(Xm, alpha-2*sigma, .8))
-    print "\t -1*sigma: "+str(CalculateTimeout(Xm, alpha-sigma, .8))
-    print "\t  0*sigma: "+str(CalculateTimeout(Xm, alpha, .8))
-    print "\t +1*sigma: "+str(CalculateTimeout(Xm, alpha+1*sigma, .8))
-    print "\t +2*sigma: "+str(CalculateTimeout(Xm, alpha+2*sigma, .8))
+    print "Timeouts for Xm: "+str(Xm)+", alpha: "+str(alpha)+" n="+str(n)+" sigma: "+str(sigma)
+    t=CalculateTimeout(Xm, alpha-2*sigma, .8)
+    print "\t -2*sigma: "+str(round(t,1))+" timeout %="+str(round(100*ParetoF(Xm, alpha, t*1000),1))
+    t=CalculateTimeout(Xm, alpha-1*sigma, .8)
+    print "\t -1*sigma: "+str(round(t,1))+" timeout %="+str(round(100*ParetoF(Xm, alpha, t*1000),1))
+    t=CalculateTimeout(Xm, alpha, .8)
+    print "\t  0*sigma: "+str(round(t,1))+" timeout %="+str(round(100*ParetoF(Xm, alpha, t*1000),1))
+    t=CalculateTimeout(Xm, alpha+1*sigma, .8)
+    print "\t +1*sigma: "+str(round(t,1))+" timeout %="+str(round(100*ParetoF(Xm, alpha, t*1000),1))
+    t=CalculateTimeout(Xm, alpha+2*sigma, .8)
+    print "\t +2*sigma: "+str(round(t,1))+" timeout %="+str(round(100*ParetoF(Xm, alpha, t*1000),1))
 
+
 dump_table(1950, 1.4)
 print
 print



More information about the tor-commits mailing list