From 18aa2dd933f4c76ebd374b42fa10d0067870f135 Mon Sep 17 00:00:00 2001 From: Ben Green Date: Thu, 11 Jun 2015 18:20:55 -0400 Subject: cleaned up code with some minor changes --- experiments/process.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'experiments/process.py') diff --git a/experiments/process.py b/experiments/process.py index ec25d8e..5c4c215 100644 --- a/experiments/process.py +++ b/experiments/process.py @@ -6,21 +6,16 @@ from itertools import product from math import exp -def print_ll(alpha, delta): - beta, roots, ll = ml(root_victims, victims, non_victims, alpha, delta) - print "\t".join(map(str, [alpha, delta, beta, roots, ll, exp(ll)])) + "\n" - - if __name__ == "__main__": if len(sys.argv) < 2: sys.exit("usage: {0} ".format(sys.argv[0])) root_victims, victims, non_victims, age = load(open(sys.argv[1])) - alpha = 1. / np.arange(1., 1000., 10.) # parameter of the time component - delta = np.arange(0.01, 0.9, 0.03) # parameter of the structural component - with open("out.log", "a") as fh: + alpha = 1. / np.arange(1., 1000., 100.) # parameter of the time component + delta = np.arange(0.01, 0.9, 0.1) # parameter of the structural component + with open("out.log", "w") as fh: for a, d in product(alpha, delta): beta, roots, ll = ml(root_victims, victims, non_victims, age, a, d) - print beta + print "\t".join(map(str, [a, d, beta, roots, ll, exp(ll)])) fh.write("\t".join(map(str, [a, d, beta, roots, ll])) + "\n") fh.flush() -- cgit v1.2.3-70-g09d2