summaryrefslogtreecommitdiffstats
path: root/hawkes_experiments/refine.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2015-09-15 16:48:11 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2015-09-15 16:48:11 -0400
commit6db9e7baeda21cd5d38f390cc84f91c3d23e054b (patch)
treefecae5b709f86d7b193ec7f33127ba619d8f2692 /hawkes_experiments/refine.py
parent959bd80bae991aca3fa4c43e2e2ae81ccf00b1a4 (diff)
downloadcriminal_cascades-6db9e7baeda21cd5d38f390cc84f91c3d23e054b.tar.gz
Squared model
Diffstat (limited to 'hawkes_experiments/refine.py')
-rw-r--r--hawkes_experiments/refine.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/hawkes_experiments/refine.py b/hawkes_experiments/refine.py
index 02bbe07..6acb382 100644
--- a/hawkes_experiments/refine.py
+++ b/hawkes_experiments/refine.py
@@ -24,10 +24,10 @@ def approx(x):
def ll(lamb, alpha, mu):
r1 = sum(log(lamb * (1 + 0.43 * sin(0.0172 * t1 + 4.36))
- + sum(alpha / d * mu * exp(-mu * (t1 - t2))
+ + sum(alpha / d ** 2 * mu * exp(-mu * (t1 - t2))
for (n2, t2, d) in s))
for ((n1, t1), s) in event_edges.iteritems())
- r2 = sum(sum(alpha / d * approx(mu * (nodes[n2][0] - t1))
+ r2 = sum(sum(alpha / d ** 2 * approx(mu * (nodes[n2][0] - t1))
for n2, d in edges[n1].iteritems()
if nodes[n2][0] > t1)
for (n1, t1) in iter_events(events))
@@ -45,7 +45,7 @@ def get_values():
for line in open("refine.txt"):
v = map(float, line.strip().split())
d[tuple(v[:3])] = v[3]
- for a, _ in l[:100]:
+ for a, _ in l[:20]:
t = [1. / i for i in range(2, 4)] + [float(i) for i in range(1, 4)]
for b in product(t, repeat=3):
l, al, m = inprod(a, b)