aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-09-25 18:48:51 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-09-25 18:48:51 -0400
commit00223904295fdecd6f3d199bbded4632fd353877 (patch)
tree01549873436858fed0182500eb023547f18f0da6
parentafbe6a6bf1e7248aa0bdaf506413d604c974002c (diff)
bugfix: correctly modify constant coefficient to obtain upper bound
-rwxr-xr-xcsv_tool2
1 files changed, 1 insertions, 1 deletions
diff --git a/csv_tool b/csv_tool
index 96cd99e..17ad949 100755
--- a/csv_tool
+++ b/csv_tool
@@ -112,7 +112,7 @@ def numpy_lstsq(x, y):
112 return lstsq(A, b)[0] 112 return lstsq(A, b)[0]
113 113
114def max_delta(c0, c1, x, y): 114def max_delta(c0, c1, x, y):
115 return max([abs(c0 + c1 * float(x) - float(y)) for (x,y) in izip(x, y)]) 115 return max([float(y) - (c0 + c1 * float(x)) for (x,y) in izip(x, y)])
116 116
117def least_squares(rows, xy_pairs, upper_bound): 117def least_squares(rows, xy_pairs, upper_bound):
118 cols = [] 118 cols = []