From 375f29ab4306821c888fd9ef0637f9ab2879e375 Mon Sep 17 00:00:00 2001 From: Ben Green Date: Thu, 2 Jul 2015 00:41:49 -0400 Subject: in which the model works!! --- experiments/process.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'experiments/process.py') diff --git a/experiments/process.py b/experiments/process.py index 0115bd4..a0c9b98 100644 --- a/experiments/process.py +++ b/experiments/process.py @@ -15,29 +15,29 @@ if __name__ == "__main__": sys.exit("usage: {0} ".format(sys.argv[0])) root_victims, victims, non_victims, age = load(open(sys.argv[1])) - # # alphas = np.arange(1e-3, 1e-2, 8e-4) # parameter of the time component - # alphas = np.logspace(-4,-1,num=15) - # # deltas = np.arange(0.001, 0.3, 0.008) # parameter of the structural component - # deltas = np.logspace(-4,-1.7,num=15) - # with open("out.log", "w") as fh: - # for alpha, delta in product(alphas, deltas): - # beta, roots, ll = ml3(root_victims, victims, non_victims, age, alpha, delta) - # print "\t".join(map(str, [alpha, delta, beta, roots, ll])) - # fh.write("\t".join(map(str, [alpha, delta, beta, roots, ll])) + "\n") - # fh.flush() - - alphas = np.arange(.15, .25, .01) # parameter of the time component - # alphas = np.logspace(-4,-.5,num=15) - deltas = np.arange(.08, .1, .01) # parameter of the structural component - # deltas = np.logspace(-2,-.1,num=15) - lmbda = 0.10#np.logspace(-12,-3,num=10) + # alphas = np.arange(.02, .1, .01) # parameter of the time component + alphas = np.logspace(-3,-1,num=10) + # deltas = np.arange(.02, .1, .01) # parameter of the structural component + deltas = np.logspace(-3,-1,num=10) with open("out.log", "w") as fh: for alpha, delta in product(alphas, deltas): - lmbda, roots, ll = ml2(root_victims, victims, non_victims, alpha, delta, lmbda) - print "\t".join(map(str, [alpha, delta, lmbda, roots, ll])) - fh.write("\t".join(map(str, [alpha, delta, lmbda, roots, ll])) + "\n") + beta, roots, ll = ml(root_victims, victims, non_victims, age, alpha, delta) + print "\t".join(map(str, [alpha, delta, beta, roots, ll])) + fh.write("\t".join(map(str, [alpha, delta, beta, roots, ll])) + "\n") fh.flush() + # alphas = np.arange(.15, .25, .01) # parameter of the time component + # # alphas = np.logspace(-4,-.5,num=15) + # deltas = np.arange(.08, .1, .01) # parameter of the structural component + # # deltas = np.logspace(-2,-.1,num=15) + # lmbda = 0.10#np.logspace(-12,-3,num=10) + # with open("out.log", "w") as fh: + # for alpha, delta in product(alphas, deltas): + # lmbda, roots, ll = ml2(root_victims, victims, non_victims, alpha, delta, lmbda) + # print "\t".join(map(str, [alpha, delta, lmbda, roots, ll])) + # fh.write("\t".join(map(str, [alpha, delta, lmbda, roots, ll])) + "\n") + # fh.flush() + # alpha = .016 # delta = 0.077 # beta, roots, ll = ml2(root_victims, victims, non_victims, alpha, delta, 1.) -- cgit v1.2.3-70-g09d2