summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Green <ben@SEASITs-MacBook-Pro.local>2015-06-28 17:38:33 -0400
committerBen Green <ben@SEASITs-MacBook-Pro.local>2015-06-28 17:38:33 -0400
commit6e527bbf612465bf5d739b9652abc0165550993c (patch)
tree9525bed16d9e4568747855afd84a03937090f1cb
parent7167a81cfb8b872dd1547e5a8669004b191417db (diff)
downloadcriminal_cascades-6e527bbf612465bf5d739b9652abc0165550993c.tar.gz
Worked on synthetic data recovery so we can tell how high the actual
infector is ranked among all potential parents. Cleaned up code for the predicting victims benchmarking test.
-rw-r--r--R Scripts/benchmarking.R130
-rw-r--r--R Scripts/find-cascades.R11
-rw-r--r--R Scripts/find-parents.R40
-rw-r--r--R Scripts/generate-network.R5
-rw-r--r--R Scripts/predict-victims-plots.R61
-rw-r--r--R Scripts/predict-victims.R67
-rw-r--r--experiments/build/temp.macosx-10.6-x86_64-2.7/ml3.obin277036 -> 285944 bytes
-rwxr-xr-xexperiments/ml2.sobin123652 -> 123652 bytes
-rw-r--r--experiments/ml3.c463
-rw-r--r--experiments/ml3.pyx15
-rwxr-xr-xexperiments/ml3.sobin106764 -> 110884 bytes
-rw-r--r--experiments/out.log960
-rw-r--r--experiments/process.py32
13 files changed, 659 insertions, 1125 deletions
diff --git a/R Scripts/benchmarking.R b/R Scripts/benchmarking.R
deleted file mode 100644
index 1cf99e0..0000000
--- a/R Scripts/benchmarking.R
+++ /dev/null
@@ -1,130 +0,0 @@
-library(igraph)
-setwd('~/Documents/Cascade Project')
-load('Raw Data/lcc.RData')
-load('Results/hyper-lcc.RData')
-load('Results/dag_dat_all.RData')
-source('Scripts/temporal.R')
-source('Scripts/structural.R')
-
-##### Initialize data
-formula = vic ~ sex + race + age + gang.member + gang.name
-lcc_verts$sex = as.factor(lcc_verts$sex)
-lcc_verts$race = as.factor(lcc_verts$race)
-lcc_verts$age = as.numeric(lcc_verts$age)
-lcc_verts$gang.name = as.factor(lcc_verts$gang.name)
-# sum(hyp_lcc_verts$vic)/length(days)
-
-##### Loop through days
-alpha = 1/100
-gamma = 0.18
-days = 70:max(hyp_lcc_verts$vic.day, na.rm=T)
-lambdas = 0#c(0, exp(seq(log(0.0000001), log(.0005), length.out=150)), 1)
-nvics = sum(hyp_lcc_verts$vic.day %in% days)
-correct_rank = matrix(nrow=nvics, ncol=length(lambdas))
-# correct_rank1 = correct_rank2 = correct_rank3 = c()
-edges_all = dag_dat_all[dag_dat_all$dist<2,]
-ptm = proc.time()
-for (day in days){
- if (day %% 100 == 0) print(day)
-
- ##### Demographics model
-# vics = match(unique(hyp_lcc_verts$ir_no[which(hyp_lcc_verts$vic.day<day)]),lcc_verts$name)
-# victims = lcc_verts[,c('vic','sex','race','age','gang.member','gang.name')]
-# victims$vic[vics] = TRUE
-# victims$vic[-vics] = FALSE
-# # glm.fit = glm(formula, data=victims, family=binomial)
-# glm.fit = lm(formula, data=victims)
-# glm.probs = predict(glm.fit, newdata=lcc_verts, type='response')
-
- ##### Cascade Model
- edges = edges_all[which(edges_all$t1<day),]
- f = temporal(edges$t1, day, alpha)
- h = structural(gamma,edges$dist)
- weights = f*h
- ids = edges$to
- irs = hyp_lcc_verts$ir_no[ids]
- risk = data.frame(id=ids, ir=irs, weight=weights)
- risk = risk[order(weights, decreasing=T),]
- risk = risk[match(unique(risk$ir),risk$ir),]
-# maybe need to change this to reflect new algorithm that accounts for \tilde{p}
-
- ##### Combined Model
-# combined = data.frame(ir=attr(glm.probs,'name'), dem=as.numeric(glm.probs), cas=0, comb=0)
- combined$cas[match(risk$ir, attr(glm.probs,'name'))] = risk$weight
-
- ##### Gather results
- infected_irs = hyp_lcc_verts$ir_no[which(hyp_lcc_verts$vic.day==day)]
- for (lambda in lambdas){
- combined$comb = combined$cas#lambda*combined$dem + (1-lambda)*(1-combined$dem)*combined$cas
- c_idx = which(lambdas==lambda)
- r_idx = head(which(is.na(correct_rank[,c_idx])),length(infected_irs))
- # !! order should be first: rank of (3,5,5,7) should be (1,2,2,4), may need to do n-rank
- correct_rank[r_idx,c_idx] = match(infected_irs, combined$ir[order(combined$comb, decreasing=T)])
- # maybe should also mark down vic/nonvic status of each?
- }
-
-}
-print(proc.time()-ptm)
-
-
-##### Plot results
-hist(correct_rank3,150,xlim=c(0,vcount(lcc)),col=rgb(0,0,1,1/8),
- xlab='Risk Ranking of Victims',main='')
-hist(correct_rank1,150,xlim=c(0,vcount(lcc)),col=rgb(1,0,1,1/8),add=T)
-hist(correct_rank2,150,xlim=c(0,vcount(lcc)),col=rgb(1,0,1,1/8),add=T)
-legend("topright", c("Demographics Model", "Cascade Model"),
- fill=c(rgb(1,0,1,1/8), rgb(0,0,1,1/8)))
-
-counts = matrix(c(colSums(correct_rank<(vcount(lcc)/1000))*100/nvics,
- colSums(correct_rank<(vcount(lcc)/200))*100/nvics,
- colSums(correct_rank<(vcount(lcc)/100))*100/nvics),
- nrow=3, byrow=T)
-plot(lambdas,counts[1,],log='x',type='l')
-
-correct_rank1 = correct_rank[,length(lambdas)]
-correct_rank2 = correct_rank[,1]
-correct_rank3 = correct_rank[,which.min(colMeans(correct_rank))]
-counts = matrix(c(sum(correct_rank1<(vcount(lcc)*0.001)),
- sum(correct_rank1<(vcount(lcc)*0.005)),
- sum(correct_rank1<(vcount(lcc)*0.01)),
- sum(correct_rank2<(vcount(lcc)*0.001)),
- sum(correct_rank2<(vcount(lcc)*0.005)),
- sum(correct_rank2<(vcount(lcc)*0.01)),
- sum(correct_rank3<(vcount(lcc)*0.001)),
- sum(correct_rank3<(vcount(lcc)*0.005)),
- sum(correct_rank3<(vcount(lcc)*0.01))),
- nrow=3, byrow=T)
-counts = counts*100/nvics
-barplot(counts,
- xlab="Size of High-Risk Population",
- ylab="Percent of Victims Predicted",
- names.arg=c('0.1%','0.5%','1%'),ylim=c(0,max(counts)*1.1),
- col=c(rgb(0,0,1,1/2),rgb(1,0,0,1/2),rgb(0,1,0,1/2)),
- beside=TRUE)
-legend("topleft", inset=0.05,
- c("Demographics Model", "Cascade Model", "Combined Model"),
- fill=c(rgb(0,0,1,1/2),rgb(1,0,0,1/2),rgb(0,1,0,1/2)))
-box(which='plot')
-par(new=T)
-counts = counts/(100/nvics)
-barplot(counts,
- ylim=c(0,max(counts)*1.1),
- col=c(rgb(0,0,1,0),rgb(1,0,0,0),rgb(0,1,0,0)),
- beside=TRUE)
-axis(side = 4)
-mtext(side = 4, line = 3, "Number of Victims Predicted")
-
-popsizes = c(0.1, 0.5, 1)
-plot(popsizes,counts[1,],type='l',ylim=c(0,max(counts)))
-lines(popsizes,counts[2,])
-lines(popsizes,counts[3,])
-lines(c(0,1),c(0,1))
-
-#### Precision-Recall Curve
-plot(ecdf(correct_rank1),col='red',xlim=c(0,vcount(lcc)),lwd=2)
-plot(ecdf(correct_rank2),col='darkblue',lwd=2,add=T)
-plot(ecdf(correct_rank3),col='darkgreen',lwd=2,add=T)
-legend("bottomright", inset=0.05,
- c("Demographics Model", "Cascade Model", "Combined Model"),
- fill=c('red','darkblue','darkgreen'))
-lines(c(0,vcount(lcc)),c(0,1))
diff --git a/R Scripts/find-cascades.R b/R Scripts/find-cascades.R
index 0a69c5c..7673909 100644
--- a/R Scripts/find-cascades.R
+++ b/R Scripts/find-cascades.R
@@ -9,14 +9,14 @@ source('criminal_cascades/R Scripts/structural.R')
vic_ids = which(V(hyp_lcc)$vic==TRUE)
#### Initialize model parameters
-alpha = 1/21
+alpha = 0.041
# gamma = 0.3
-delta = 0.001
-beta = 0.00796964464237
+delta = 0.1
+# beta = 0.00796964464237
##### Get weights
# find max n days where infection possible given alpha
-edges = dag_dat_vics
+edges = dag_dat_test[!is.na(dag_dat_test$t2),]
# edges = edges[(edges$t2-edges$t1)<300,]
p_t = temporal(edges$t1, edges$t2, alpha)
@@ -31,7 +31,7 @@ weights = p/p_tilde
# probs = as.numeric(lm.probs)
# betas = probs[match(hyp_lcc_verts$ir_no[edges$to],names)]
# betas = 0.055
-thresh = beta/(1-beta)
+# thresh = beta/(1-beta)
realized = c()
# edges = edges[weights>thresh,]
@@ -51,6 +51,7 @@ for (u in vic_ids){
}
realized = c(realized, max_edge)
}
+edges[realized,c('from','to')]
# if (length(Ei)>0){
# max_edge = Ei[which.max(weights[Ei])] # how to deal with ties????
# realized = c(realized, max_edge)
diff --git a/R Scripts/find-parents.R b/R Scripts/find-parents.R
new file mode 100644
index 0000000..3ec8809
--- /dev/null
+++ b/R Scripts/find-parents.R
@@ -0,0 +1,40 @@
+# library(igraph)
+# setwd("~/Documents/Cascade Project/")
+# load('Results/hyper-lcc.RData')
+# load('Results/dag_dat_vics.RData')
+# source('criminal_cascades/R Scripts/temporal.R')
+# source('criminal_cascades/R Scripts/structural.R')
+
+##### Initialize parameters based on what ml2 found
+alpha = 0.061
+delta = 0.082
+
+##### Get weights
+edges = dag_dat_test[!is.na(dag_dat_test$t2),]
+
+dt = edges$t2 - edges$t1
+p_t = exp(-alpha*dt) * (exp(alpha)-1)
+p_s = structural(delta, edges$dist)
+p = p_s * p_t
+p_tilde = 1 - p_s + p_s * exp(-alpha*dt)
+weights = p/p_tilde
+edges$weight = weights
+
+##### Find most likely parents
+parents = data.frame(vic=0,Npars=0,par_rank=0)
+vics = setdiff(vic_ids,seeds)
+for (u in vics){
+ u_parents = edges[edges$to==u,]
+ u_parents = u_parents[order(u_parents$weight,decreasing=T),]
+ Nparents = dim(u_parents)[1]
+ infector = V(g)$infector[u]
+ infectorID = which(u_parents$from==infector)
+ parents[which(vics==u),] = c(u, Nparents, infectorID)
+}
+
+##### Get some summary statistics on how well
+median(parents$par_rank[parents$Npars>9])
+median(parents$par_rank[parents$Npars>99])
+
+
+
diff --git a/R Scripts/generate-network.R b/R Scripts/generate-network.R
index dc4a4f8..3b40969 100644
--- a/R Scripts/generate-network.R
+++ b/R Scripts/generate-network.R
@@ -9,7 +9,6 @@ delta = 0.15
# lmbda = 1/10
t_max = 1000
-# g = watts.strogatz.game(1, 100, 3, 0.25)
N = 5000
g = forest.fire.game(nodes=N, fw.prob=0.3, ambs=1, directed=F)
plot(g, vertex.size=5, vertex.label=NA)
@@ -31,7 +30,7 @@ for (day in 1:t_max){
infected = setdiff(infected,seeds) # don't try to infect seeds
inf.days = day + ceiling(alpha*rexp(length(infected),alpha))
V(g)$vic[infected] = TRUE
- infects = (inf.days < V(g)$vic.day[infected]) %in% c(NA,T)
+ infects = (inf.days <= V(g)$vic.day[infected]) %in% c(NA,T)
V(g)$vic.day[infected[infects]] = inf.days[infects]
V(g)$infector[infected[infects]] = vic
}
@@ -76,3 +75,5 @@ infectors = cbind(setdiff(vic_ids,seeds),
V(g)$infector[setdiff(vic_ids,seeds)],
recovered$infector[recovered$victim %in% setdiff(vic_ids,seeds)])
mean(infectors[,2]==infectors[,3])
+
+dag_dat_test[dag_dat_test$to==4984,] \ No newline at end of file
diff --git a/R Scripts/predict-victims-plots.R b/R Scripts/predict-victims-plots.R
new file mode 100644
index 0000000..8a93667
--- /dev/null
+++ b/R Scripts/predict-victims-plots.R
@@ -0,0 +1,61 @@
+##### Plot results
+hist(correct_rank3,150,xlim=c(0,vcount(lcc)),col=rgb(0,0,1,1/8),
+ xlab='Risk Ranking of Victims',main='')
+hist(correct_rank1,150,xlim=c(0,vcount(lcc)),col=rgb(1,0,1,1/8),add=T)
+hist(correct_rank2,150,xlim=c(0,vcount(lcc)),col=rgb(1,0,1,1/8),add=T)
+legend("topright", c("Demographics Model", "Cascade Model"),
+ fill=c(rgb(1,0,1,1/8), rgb(0,0,1,1/8)))
+
+counts = matrix(c(colSums(correct_rank<(vcount(lcc)/1000))*100/nvics,
+ colSums(correct_rank<(vcount(lcc)/200))*100/nvics,
+ colSums(correct_rank<(vcount(lcc)/100))*100/nvics),
+ nrow=3, byrow=T)
+plot(lambdas,counts[1,],log='x',type='l')
+
+correct_rank1 = correct_rank[,length(lambdas)]
+correct_rank2 = correct_rank[,1]
+correct_rank3 = correct_rank[,which.min(colMeans(correct_rank))]
+counts = matrix(c(sum(correct_rank1<(vcount(lcc)*0.001)),
+ sum(correct_rank1<(vcount(lcc)*0.005)),
+ sum(correct_rank1<(vcount(lcc)*0.01)),
+ sum(correct_rank2<(vcount(lcc)*0.001)),
+ sum(correct_rank2<(vcount(lcc)*0.005)),
+ sum(correct_rank2<(vcount(lcc)*0.01)),
+ sum(correct_rank3<(vcount(lcc)*0.001)),
+ sum(correct_rank3<(vcount(lcc)*0.005)),
+ sum(correct_rank3<(vcount(lcc)*0.01))),
+ nrow=3, byrow=T)
+counts = counts*100/nvics
+barplot(counts,
+ xlab="Size of High-Risk Population",
+ ylab="Percent of Victims Predicted",
+ names.arg=c('0.1%','0.5%','1%'),ylim=c(0,max(counts)*1.1),
+ col=c(rgb(0,0,1,1/2),rgb(1,0,0,1/2),rgb(0,1,0,1/2)),
+ beside=TRUE)
+legend("topleft", inset=0.05,
+ c("Demographics Model", "Cascade Model", "Combined Model"),
+ fill=c(rgb(0,0,1,1/2),rgb(1,0,0,1/2),rgb(0,1,0,1/2)))
+box(which='plot')
+par(new=T)
+counts = counts/(100/nvics)
+barplot(counts,
+ ylim=c(0,max(counts)*1.1),
+ col=c(rgb(0,0,1,0),rgb(1,0,0,0),rgb(0,1,0,0)),
+ beside=TRUE)
+axis(side = 4)
+mtext(side = 4, line = 3, "Number of Victims Predicted")
+
+popsizes = c(0.1, 0.5, 1)
+plot(popsizes,counts[1,],type='l',ylim=c(0,max(counts)))
+lines(popsizes,counts[2,])
+lines(popsizes,counts[3,])
+lines(c(0,1),c(0,1))
+
+#### Precision-Recall Curve
+plot(ecdf(correct_rank1),col='red',xlim=c(0,vcount(lcc)),lwd=2)
+plot(ecdf(correct_rank2),col='darkblue',lwd=2,add=T)
+plot(ecdf(correct_rank3),col='darkgreen',lwd=2,add=T)
+legend("bottomright", inset=0.05,
+ c("Demographics Model", "Cascade Model", "Combined Model"),
+ fill=c('red','darkblue','darkgreen'))
+lines(c(0,vcount(lcc)),c(0,1))
diff --git a/R Scripts/predict-victims.R b/R Scripts/predict-victims.R
new file mode 100644
index 0000000..470815d
--- /dev/null
+++ b/R Scripts/predict-victims.R
@@ -0,0 +1,67 @@
+library(igraph)
+setwd('~/Documents/Cascade Project')
+load('Raw Data/lcc.RData')
+load('Results/hyper-lcc.RData')
+load('Results/dag_dat_all.RData')
+source('criminal_cascades/R Scripts/temporal.R')
+source('criminal_cascades/R Scripts/structural.R')
+
+##### Initialize data
+formula = vic ~ sex + race + age + gang.member + gang.name
+lcc_verts$sex = as.factor(lcc_verts$sex)
+lcc_verts$race = as.factor(lcc_verts$race)
+lcc_verts$age = as.numeric(lcc_verts$age)
+lcc_verts$gang.name = as.factor(lcc_verts$gang.name)
+# sum(hyp_lcc_verts$vic)/length(days)
+
+alpha = 0.0028
+delta = 0.06
+days = sort(unique(hyp_lcc_verts$vic.day)) # 70:max(hyp_lcc_verts$vic.day, na.rm=T)
+lambdas = c(0,1)#c(0, exp(seq(log(0.0000001), log(.0005), length.out=150)), 1)
+nvics = sum(lcc_verts$vic)#sum(hyp_lcc_verts$vic.day %in% days)
+correct_rank = matrix(nrow=nvics, ncol=length(lambdas))
+edges_all = dag_dat_all
+
+##### Loop through days
+ptm = proc.time()
+for (day in days){
+ if (which(day==days) %% 100 == 0) print(day)
+
+ ##### Demographics model
+ vics = match(unique(hyp_lcc_verts$ir_no[which(hyp_lcc_verts$vic.day<day)]),lcc_verts$name)
+ victims = lcc_verts[,c('vic','sex','race','age','gang.member','gang.name')]
+ victims$vic[vics] = TRUE
+ victims$vic[-vics] = FALSE
+# glm.fit = glm(formula, data=victims, family=binomial)
+ glm.fit = lm(formula, data=victims)
+ glm.probs = predict(glm.fit, newdata=lcc_verts, type='response')
+
+ ##### Cascade Model
+ edges = edges_all[which(edges_all$t1<day),]
+ f = temporal(edges$t1, day, alpha)
+ h = structural(delta,edges$dist)
+ weights = f*h
+ ids = edges$to
+ irs = hyp_lcc_verts$ir_no[ids]
+ risk = data.frame(id=ids, ir=irs, weight=weights)
+ risk = risk[order(weights, decreasing=T),]
+ risk = risk[match(unique(risk$ir),risk$ir),]
+# maybe need to change this to reflect new algorithm that accounts for \tilde{p}
+
+ ##### Combined Model
+ combined = data.frame(ir=attr(glm.probs,'name'), dem=as.numeric(glm.probs), cas=0, comb=0)
+ combined$cas[match(risk$ir, attr(glm.probs,'name'))] = risk$weight
+
+ ##### Gather results
+ infected_irs = hyp_lcc_verts$ir_no[which(hyp_lcc_verts$vic.day==day)]
+ for (lambda in lambdas){
+ combined$comb = lambda*combined$dem + (1-lambda)*combined$cas
+ c_idx = which(lambdas==lambda)
+ r_idx = head(which(is.na(correct_rank[,c_idx])),length(infected_irs))
+ # !! order should be first: rank of (3,5,5,7) should be (1,2,2,4), may need to do n-rank
+ correct_rank[r_idx,c_idx] = match(infected_irs, combined$ir[order(combined$comb, decreasing=T)])
+ # maybe should also mark down vic/nonvic status of each?
+ }
+
+}
+print(proc.time()-ptm)
diff --git a/experiments/build/temp.macosx-10.6-x86_64-2.7/ml3.o b/experiments/build/temp.macosx-10.6-x86_64-2.7/ml3.o
index e928c51..8ac85ca 100644
--- a/experiments/build/temp.macosx-10.6-x86_64-2.7/ml3.o
+++ b/experiments/build/temp.macosx-10.6-x86_64-2.7/ml3.o
Binary files differ
diff --git a/experiments/ml2.so b/experiments/ml2.so
index 162e007..515e455 100755
--- a/experiments/ml2.so
+++ b/experiments/ml2.so
Binary files differ
diff --git a/experiments/ml3.c b/experiments/ml3.c
index 12d0e1d..59de174 100644
--- a/experiments/ml3.c
+++ b/experiments/ml3.c
@@ -695,7 +695,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
* DTYPE = np.float64
* ctypedef np.float_t DTYPE_t # <<<<<<<<<<<<<<
*
- * cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, DTYPE_t delta,
+ * cdef DTYPE_t weight_success(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta,
*/
typedef __pyx_t_5numpy_float_t __pyx_t_3ml3_DTYPE_t;
#if CYTHON_CCOMPLEX
@@ -914,6 +914,18 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#endif
#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
+static double __Pyx__PyObject_AsDouble(PyObject* obj);
+#if CYTHON_COMPILING_IN_PYPY
+#define __Pyx_PyObject_AsDouble(obj) \
+(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \
+ likely(PyInt_CheckExact(obj)) ? \
+ PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
+#else
+#define __Pyx_PyObject_AsDouble(obj) \
+((likely(PyFloat_CheckExact(obj))) ? \
+ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
+#endif
+
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
@@ -935,18 +947,6 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list, int wraparound, int boundscheck);
-static double __Pyx__PyObject_AsDouble(PyObject* obj);
-#if CYTHON_COMPILING_IN_PYPY
-#define __Pyx_PyObject_AsDouble(obj) \
-(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \
- likely(PyInt_CheckExact(obj)) ? \
- PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
-#else
-#define __Pyx_PyObject_AsDouble(obj) \
-((likely(PyFloat_CheckExact(obj))) ? \
- PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
-#endif
-
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
@@ -1169,8 +1169,8 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, cha
/* Module declarations from 'libc.math' */
/* Module declarations from 'ml3' */
-static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int, int, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t); /*proto*/
-static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_failure(int, int, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t); /*proto*/
+static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t); /*proto*/
+static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_failure(int, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t, __pyx_t_3ml3_DTYPE_t); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_3ml3_DTYPE_t = { "DTYPE_t", NULL, sizeof(__pyx_t_3ml3_DTYPE_t), { 0 }, 0, 'R', 0, 0 };
#define __Pyx_MODULE_NAME "ml3"
int __pyx_module_is_main_ml3 = 0;
@@ -1329,7 +1329,6 @@ static PyObject *__pyx_n_s_w3;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_float_1_;
static PyObject *__pyx_float_0_00001;
-static PyObject *__pyx_float_neg_19_523275053840013;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_tuple_;
@@ -1345,12 +1344,12 @@ static PyObject *__pyx_codeobj__9;
/* "ml3.pyx":9
* ctypedef np.float_t DTYPE_t
*
- * cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
+ * cdef DTYPE_t weight_success(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
* DTYPE_t w1, DTYPE_t w2, DTYPE_t w3):
* """weight for successful infection, exponential time model"""
*/
-static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int __pyx_v_dist, int __pyx_v_dt, __pyx_t_3ml3_DTYPE_t __pyx_v_alpha, __pyx_t_3ml3_DTYPE_t __pyx_v_delta, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w1, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w2, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w3) {
+static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int __pyx_v_dist, __pyx_t_3ml3_DTYPE_t __pyx_v_dt, __pyx_t_3ml3_DTYPE_t __pyx_v_alpha, __pyx_t_3ml3_DTYPE_t __pyx_v_delta, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w1, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w2, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w3) {
__pyx_t_3ml3_DTYPE_t __pyx_v_structural;
__pyx_t_3ml3_DTYPE_t __pyx_v_temporal;
__pyx_t_3ml3_DTYPE_t __pyx_v_result;
@@ -1390,7 +1389,7 @@ static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int __pyx_v_dist, int __
* result = log(structural) + temporal
* return result # <<<<<<<<<<<<<<
*
- * cdef DTYPE_t weight_failure(int dist, int dt, DTYPE_t alpha, DTYPE_t delta,
+ * cdef DTYPE_t weight_failure(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta,
*/
__pyx_r = __pyx_v_result;
goto __pyx_L0;
@@ -1398,7 +1397,7 @@ static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int __pyx_v_dist, int __
/* "ml3.pyx":9
* ctypedef np.float_t DTYPE_t
*
- * cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
+ * cdef DTYPE_t weight_success(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
* DTYPE_t w1, DTYPE_t w2, DTYPE_t w3):
* """weight for successful infection, exponential time model"""
*/
@@ -1412,12 +1411,12 @@ static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_success(int __pyx_v_dist, int __
/* "ml3.pyx":18
* return result
*
- * cdef DTYPE_t weight_failure(int dist, int dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
+ * cdef DTYPE_t weight_failure(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
* DTYPE_t w1, DTYPE_t w2, DTYPE_t w3):
* """weight for failed infection, exponential time model"""
*/
-static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_failure(int __pyx_v_dist, int __pyx_v_dt, __pyx_t_3ml3_DTYPE_t __pyx_v_alpha, __pyx_t_3ml3_DTYPE_t __pyx_v_delta, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w1, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w2, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w3) {
+static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_failure(int __pyx_v_dist, __pyx_t_3ml3_DTYPE_t __pyx_v_dt, __pyx_t_3ml3_DTYPE_t __pyx_v_alpha, __pyx_t_3ml3_DTYPE_t __pyx_v_delta, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w1, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w2, CYTHON_UNUSED __pyx_t_3ml3_DTYPE_t __pyx_v_w3) {
__pyx_t_3ml3_DTYPE_t __pyx_v_structural;
__pyx_t_3ml3_DTYPE_t __pyx_v_temporal;
__pyx_t_3ml3_DTYPE_t __pyx_v_result;
@@ -1465,7 +1464,7 @@ static __pyx_t_3ml3_DTYPE_t __pyx_f_3ml3_weight_failure(int __pyx_v_dist, int __
/* "ml3.pyx":18
* return result
*
- * cdef DTYPE_t weight_failure(int dist, int dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
+ * cdef DTYPE_t weight_failure(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta, # <<<<<<<<<<<<<<
* DTYPE_t w1, DTYPE_t w2, DTYPE_t w3):
* """weight for failed infection, exponential time model"""
*/
@@ -1660,12 +1659,13 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__pyx_t_3ml3_DTYPE_t __pyx_t_25;
__pyx_t_3ml3_DTYPE_t __pyx_t_26;
int __pyx_t_27;
- int __pyx_t_28;
+ double __pyx_t_28;
int __pyx_t_29;
int __pyx_t_30;
int __pyx_t_31;
- double __pyx_t_32;
- PyObject *(*__pyx_t_33)(PyObject *);
+ int __pyx_t_32;
+ int __pyx_t_33;
+ PyObject *(*__pyx_t_34)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
@@ -1921,7 +1921,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_isSeed.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_3ml3_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_isSeed.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_3ml3_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
__pyx_v_isSeed = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_isSeed.rcbuffer->pybuffer.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_pybuffernd_isSeed.diminfo[0].strides = __pyx_pybuffernd_isSeed.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_isSeed.diminfo[0].shape = __pyx_pybuffernd_isSeed.rcbuffer->pybuffer.shape[0];
@@ -1963,7 +1963,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
/* "ml3.pyx":46
* # fail to infect it, also computes the probability that its most
* # likely parent infects it
- * failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
+ * failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
* for (dist, dt, w1, w2, w3) in parents]
* probs_fail[i] = sum(failures)
*/
@@ -1972,10 +1972,10 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
/* "ml3.pyx":47
* # likely parent infects it
- * failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3)
+ * failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3)
* for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
*/
if (unlikely(__pyx_v_parents == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
@@ -2071,24 +2071,24 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
/* "ml3.pyx":46
* # fail to infect it, also computes the probability that its most
* # likely parent infects it
- * failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
+ * failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
* for (dist, dt, w1, w2, w3) in parents]
* probs_fail[i] = sum(failures)
*/
__pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_w1); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_v_w2); if (unlikely((__pyx_t_25 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_w3); if (unlikely((__pyx_t_26 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyFloat_FromDouble(__pyx_f_3ml3_weight_failure(__pyx_v_dist, __pyx_v_dt, __pyx_v_alpha, __pyx_v_delta, __pyx_t_24, __pyx_t_25, __pyx_t_26)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble(__pyx_f_3ml3_weight_failure(__pyx_v_dist, (__pyx_v_dt / 100.), __pyx_v_alpha, __pyx_v_delta, __pyx_t_24, __pyx_t_25, __pyx_t_26)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "ml3.pyx":47
* # likely parent infects it
- * failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3)
+ * failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3)
* for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
*/
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -2096,10 +2096,10 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__pyx_t_6 = 0;
/* "ml3.pyx":48
- * failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3)
+ * failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3)
* for (dist, dt, w1, w2, w3) in parents]
* probs_fail[i] = sum(failures) # <<<<<<<<<<<<<<
- * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
* for (dist, dt, w1, w2, w3) in parents]
*/
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -2119,7 +2119,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
/* "ml3.pyx":49
* for (dist, dt, w1, w2, w3) in parents]
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
+ * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
* for (dist, dt, w1, w2, w3) in parents]
* dists = [dist for (dist, dt, w1, w2, w3) in parents]
*/
@@ -2128,7 +2128,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
/* "ml3.pyx":50
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
* for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
* dists = [dist for (dist, dt, w1, w2, w3) in parents]
* dts = [dt for (dist, dt, w1, w2, w3) in parents]
@@ -2227,21 +2227,21 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
/* "ml3.pyx":49
* for (dist, dt, w1, w2, w3) in parents]
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
+ * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3) # <<<<<<<<<<<<<<
* for (dist, dt, w1, w2, w3) in parents]
* dists = [dist for (dist, dt, w1, w2, w3) in parents]
*/
__pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_w1); if (unlikely((__pyx_t_26 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_v_w2); if (unlikely((__pyx_t_25 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_w3); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyFloat_FromDouble(__pyx_f_3ml3_weight_success(__pyx_v_dist, __pyx_v_dt, __pyx_v_alpha, __pyx_v_delta, __pyx_t_26, __pyx_t_25, __pyx_t_24)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble(__pyx_f_3ml3_weight_success(__pyx_v_dist, (__pyx_v_dt / 100.), __pyx_v_alpha, __pyx_v_delta, __pyx_t_26, __pyx_t_25, __pyx_t_24)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "ml3.pyx":50
* probs_fail[i] = sum(failures)
- * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
* for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
* dists = [dist for (dist, dt, w1, w2, w3) in parents]
* dts = [dt for (dist, dt, w1, w2, w3) in parents]
@@ -2252,7 +2252,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__pyx_t_5 = 0;
/* "ml3.pyx":51
- * successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ * successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
* for (dist, dt, w1, w2, w3) in parents]
* dists = [dist for (dist, dt, w1, w2, w3) in parents] # <<<<<<<<<<<<<<
* dts = [dt for (dist, dt, w1, w2, w3) in parents]
@@ -2467,14 +2467,26 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
__Pyx_XDECREF_SET(__pyx_v_dts, ((PyObject*)__pyx_t_5));
__pyx_t_5 = 0;
+ /* "ml3.pyx":55
+ * # find parent that maximizes log(p) - log(\tilde{p})
+ * # probs[i] = max(s - failures[l] for l, s in enumerate(successes))
+ * probs[i] = float("-inf") # <<<<<<<<<<<<<<
+ * for l, s in enumerate(successes):
+ * prob = s - failures[l]
+ */
+ __pyx_t_28 = __Pyx_PyObject_AsDouble(__pyx_kp_s_inf); if (unlikely(__pyx_t_28 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_27 = __pyx_v_i;
+ if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_pybuffernd_probs.diminfo[0].shape;
+ *__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_probs.diminfo[0].strides) = __pyx_t_28;
+
/* "ml3.pyx":56
* # probs[i] = max(s - failures[l] for l, s in enumerate(successes))
- * # probs[i] = 0.
+ * probs[i] = float("-inf")
* for l, s in enumerate(successes): # <<<<<<<<<<<<<<
* prob = s - failures[l]
- * if prob > -19.523275053840013:
+ * if prob > probs[i]:
*/
- __pyx_t_27 = 0;
+ __pyx_t_14 = 0;
__pyx_t_5 = __pyx_v_successes; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
for (;;) {
if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5)) break;
@@ -2485,15 +2497,15 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
#endif
__Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_v_l = __pyx_t_27;
- __pyx_t_27 = (__pyx_t_27 + 1);
+ __pyx_v_l = __pyx_t_14;
+ __pyx_t_14 = (__pyx_t_14 + 1);
/* "ml3.pyx":57
- * # probs[i] = 0.
+ * probs[i] = float("-inf")
* for l, s in enumerate(successes):
* prob = s - failures[l] # <<<<<<<<<<<<<<
- * if prob > -19.523275053840013:
- * isSeed[i] = 0
+ * if prob > probs[i]:
+ * probs[i] = prob
*/
__pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_failures, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
__Pyx_GOTREF(__pyx_t_6);
@@ -2506,182 +2518,176 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
/* "ml3.pyx":58
* for l, s in enumerate(successes):
* prob = s - failures[l]
- * if prob > -19.523275053840013: # <<<<<<<<<<<<<<
- * isSeed[i] = 0
- * probs[i] += prob
+ * if prob > probs[i]: # <<<<<<<<<<<<<<
+ * probs[i] = prob
+ * parent_dists[i] = dists[l]
*/
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_prob, __pyx_float_neg_19_523275053840013, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_28 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_28 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_29 = __pyx_v_i;
+ if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_pybuffernd_probs.diminfo[0].shape;
+ __pyx_t_3 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_probs.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = PyObject_RichCompare(__pyx_v_prob, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_28) {
+ __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (__pyx_t_30) {
/* "ml3.pyx":59
* prob = s - failures[l]
- * if prob > -19.523275053840013:
- * isSeed[i] = 0 # <<<<<<<<<<<<<<
- * probs[i] += prob
- * parent_dists[i] = dists[l]
- */
- __pyx_t_14 = __pyx_v_i;
- if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_pybuffernd_isSeed.diminfo[0].shape;
- *__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_isSeed.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_isSeed.diminfo[0].strides) = 0.0;
-
- /* "ml3.pyx":60
- * if prob > -19.523275053840013:
- * isSeed[i] = 0
- * probs[i] += prob # <<<<<<<<<<<<<<
+ * if prob > probs[i]:
+ * probs[i] = prob # <<<<<<<<<<<<<<
* parent_dists[i] = dists[l]
* parent_dts[i] = dts[l]
*/
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_prob); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_29 = __pyx_v_i;
- if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_pybuffernd_probs.diminfo[0].shape;
- *__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_probs.diminfo[0].strides) += __pyx_t_24;
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_prob); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_31 = __pyx_v_i;
+ if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_pybuffernd_probs.diminfo[0].shape;
+ *__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_probs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_probs.diminfo[0].strides) = __pyx_t_24;
- /* "ml3.pyx":61
- * isSeed[i] = 0
- * probs[i] += prob
+ /* "ml3.pyx":60
+ * if prob > probs[i]:
+ * probs[i] = prob
* parent_dists[i] = dists[l] # <<<<<<<<<<<<<<
* parent_dts[i] = dts[l]
* # probs_fail[i] = failures[l]
*/
- __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_dists, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_30 = __pyx_v_i;
- if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_pybuffernd_parent_dists.diminfo[0].shape;
- *__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_parent_dists.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_parent_dists.diminfo[0].strides) = __pyx_t_24;
+ __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dists, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_32 = __pyx_v_i;
+ if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_pybuffernd_parent_dists.diminfo[0].shape;
+ *__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_parent_dists.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_parent_dists.diminfo[0].strides) = __pyx_t_24;
- /* "ml3.pyx":62
- * probs[i] += prob
+ /* "ml3.pyx":61
+ * probs[i] = prob
* parent_dists[i] = dists[l]
* parent_dts[i] = dts[l] # <<<<<<<<<<<<<<
* # probs_fail[i] = failures[l]
*
*/
- __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_dts, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_31 = __pyx_v_i;
- if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_pybuffernd_parent_dts.diminfo[0].shape;
- *__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_parent_dts.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_parent_dts.diminfo[0].strides) = __pyx_t_24;
+ __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dts, __pyx_v_l, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_33 = __pyx_v_i;
+ if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_pybuffernd_parent_dts.diminfo[0].shape;
+ *__Pyx_BufPtrStrided1d(__pyx_t_3ml3_DTYPE_t *, __pyx_pybuffernd_parent_dts.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_parent_dts.diminfo[0].strides) = __pyx_t_24;
goto __pyx_L23;
}
__pyx_L23:;
/* "ml3.pyx":56
* # probs[i] = max(s - failures[l] for l, s in enumerate(successes))
- * # probs[i] = 0.
+ * probs[i] = float("-inf")
* for l, s in enumerate(successes): # <<<<<<<<<<<<<<
* prob = s - failures[l]
- * if prob > -19.523275053840013:
+ * if prob > probs[i]:
*/
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "ml3.pyx":66
+ /* "ml3.pyx":65
*
* # calculate log likelihood
* ll = probs_fail.sum() # add probability that all edges to all victims fail # <<<<<<<<<<<<<<
*
* # print 'probs', probs
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs_fail), __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_probs_fail), __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = NULL;
+ __pyx_t_6 = NULL;
if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_3)) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (__pyx_t_3) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
- __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_ll = __pyx_t_24;
- /* "ml3.pyx":69
+ /* "ml3.pyx":68
*
* # print 'probs', probs
* max_beta_add = float('-inf') # <<<<<<<<<<<<<<
* # iterate over all victim nodes to find the optimal threshold
* for beta in np.arange(0.00001, 1., 1.):
*/
- __pyx_t_32 = __Pyx_PyObject_AsDouble(__pyx_kp_s_inf); if (unlikely(__pyx_t_32 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_max_beta_add = __pyx_t_32;
+ __pyx_t_28 = __Pyx_PyObject_AsDouble(__pyx_kp_s_inf); if (unlikely(__pyx_t_28 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_max_beta_add = __pyx_t_28;
- /* "ml3.pyx":71
+ /* "ml3.pyx":70
* max_beta_add = float('-inf')
* # iterate over all victim nodes to find the optimal threshold
* for beta in np.arange(0.00001, 1., 1.): # <<<<<<<<<<<<<<
* thresh = log(beta/(3012.*(1.-beta)))
* seeds = isSeed==1
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
- __pyx_t_33 = NULL;
+ __pyx_t_34 = NULL;
} else {
- __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_33 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_34 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
for (;;) {
- if (likely(!__pyx_t_33)) {
+ if (likely(!__pyx_t_34)) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
}
} else {
- __pyx_t_4 = __pyx_t_33(__pyx_t_5);
+ __pyx_t_4 = __pyx_t_34(__pyx_t_5);
if (unlikely(!__pyx_t_4)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_4);
}
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_beta = __pyx_t_24;
- /* "ml3.pyx":72
+ /* "ml3.pyx":71
* # iterate over all victim nodes to find the optimal threshold
* for beta in np.arange(0.00001, 1., 1.):
* thresh = log(beta/(3012.*(1.-beta))) # <<<<<<<<<<<<<<
@@ -2690,54 +2696,54 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_thresh = log((__pyx_v_beta / (3012. * (1. - __pyx_v_beta))));
- /* "ml3.pyx":73
+ /* "ml3.pyx":72
* for beta in np.arange(0.00001, 1., 1.):
* thresh = log(beta/(3012.*(1.-beta)))
* seeds = isSeed==1 # <<<<<<<<<<<<<<
* non_seeds = isSeed==0
* roots = n_roots + sum(seeds)
*/
- __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_isSeed), __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_isSeed), __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XDECREF_SET(__pyx_v_seeds, __pyx_t_4);
__pyx_t_4 = 0;
- /* "ml3.pyx":74
+ /* "ml3.pyx":73
* thresh = log(beta/(3012.*(1.-beta)))
* seeds = isSeed==1
* non_seeds = isSeed==0 # <<<<<<<<<<<<<<
* roots = n_roots + sum(seeds)
*
*/
- __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_isSeed), __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_isSeed), __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XDECREF_SET(__pyx_v_non_seeds, __pyx_t_4);
__pyx_t_4 = 0;
- /* "ml3.pyx":75
+ /* "ml3.pyx":74
* seeds = isSeed==1
* non_seeds = isSeed==0
* roots = n_roots + sum(seeds) # <<<<<<<<<<<<<<
*
* beta_add = 0.
*/
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_roots); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_roots); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_seeds);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seeds);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_seeds);
__Pyx_GIVEREF(__pyx_v_seeds);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_roots = __pyx_t_12;
- /* "ml3.pyx":77
+ /* "ml3.pyx":76
* roots = n_roots + sum(seeds)
*
* beta_add = 0. # <<<<<<<<<<<<<<
@@ -2746,18 +2752,18 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_beta_add = 0.;
- /* "ml3.pyx":79
+ /* "ml3.pyx":78
* beta_add = 0.
* # add probability for realized edges and subtract probability these edges fail
* beta_add += (probs[non_seeds]).sum() # <<<<<<<<<<<<<<
* # add probability for the seeds and non-seeds
* beta_add += roots * log(beta/3012.) + sum(non_seeds) * log(1. - beta)
*/
- __pyx_t_3 = PyFloat_FromDouble(__pyx_v_beta_add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_probs), __pyx_v_non_seeds); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_6 = PyFloat_FromDouble(__pyx_v_beta_add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_probs), __pyx_v_non_seeds); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
@@ -2771,69 +2777,69 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
}
}
if (__pyx_t_4) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_16); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_16); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__pyx_v_beta_add = __pyx_t_24;
- /* "ml3.pyx":81
+ /* "ml3.pyx":80
* beta_add += (probs[non_seeds]).sum()
* # add probability for the seeds and non-seeds
* beta_add += roots * log(beta/3012.) + sum(non_seeds) * log(1. - beta) # <<<<<<<<<<<<<<
*
* if beta_add > max_beta_add:
*/
- __pyx_t_16 = PyFloat_FromDouble(__pyx_v_beta_add); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyFloat_FromDouble(__pyx_v_beta_add); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_6 = PyFloat_FromDouble((__pyx_v_roots * log((__pyx_v_beta / 3012.)))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble((__pyx_v_roots * log((__pyx_v_beta / 3012.)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_non_seeds);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_non_seeds);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_non_seeds);
__Pyx_GIVEREF(__pyx_v_non_seeds);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(log((1. - __pyx_v_beta))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_17 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyFloat_FromDouble(log((1. - __pyx_v_beta))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_17 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_17); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_17); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_t_16, __pyx_t_6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_17); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_17); if (unlikely((__pyx_t_24 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__pyx_v_beta_add = __pyx_t_24;
- /* "ml3.pyx":83
+ /* "ml3.pyx":82
* beta_add += roots * log(beta/3012.) + sum(non_seeds) * log(1. - beta)
*
* if beta_add > max_beta_add: # <<<<<<<<<<<<<<
* max_beta = beta
* max_roots = roots
*/
- __pyx_t_28 = ((__pyx_v_beta_add > __pyx_v_max_beta_add) != 0);
- if (__pyx_t_28) {
+ __pyx_t_30 = ((__pyx_v_beta_add > __pyx_v_max_beta_add) != 0);
+ if (__pyx_t_30) {
- /* "ml3.pyx":84
+ /* "ml3.pyx":83
*
* if beta_add > max_beta_add:
* max_beta = beta # <<<<<<<<<<<<<<
@@ -2842,7 +2848,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_max_beta = __pyx_v_beta;
- /* "ml3.pyx":85
+ /* "ml3.pyx":84
* if beta_add > max_beta_add:
* max_beta = beta
* max_roots = roots # <<<<<<<<<<<<<<
@@ -2851,7 +2857,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_max_roots = __pyx_v_roots;
- /* "ml3.pyx":86
+ /* "ml3.pyx":85
* max_beta = beta
* max_roots = roots
* max_beta_add = beta_add # <<<<<<<<<<<<<<
@@ -2863,7 +2869,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
}
__pyx_L26:;
- /* "ml3.pyx":71
+ /* "ml3.pyx":70
* max_beta_add = float('-inf')
* # iterate over all victim nodes to find the optimal threshold
* for beta in np.arange(0.00001, 1., 1.): # <<<<<<<<<<<<<<
@@ -2873,7 +2879,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "ml3.pyx":89
+ /* "ml3.pyx":88
* # print 'beta:', max_beta, 'add:', max_beta_add, 'roots:', max_roots
*
* ll += max_beta_add # <<<<<<<<<<<<<<
@@ -2882,7 +2888,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_ll = (__pyx_v_ll + __pyx_v_max_beta_add);
- /* "ml3.pyx":90
+ /* "ml3.pyx":89
*
* ll += max_beta_add
* roots = max_roots # <<<<<<<<<<<<<<
@@ -2891,7 +2897,7 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_roots = __pyx_v_max_roots;
- /* "ml3.pyx":91
+ /* "ml3.pyx":90
* ll += max_beta_add
* roots = max_roots
* beta = max_beta # <<<<<<<<<<<<<<
@@ -2900,29 +2906,29 @@ static PyObject *__pyx_pf_3ml3_ml3(CYTHON_UNUSED PyObject *__pyx_self, PyObject
*/
__pyx_v_beta = __pyx_v_max_beta;
- /* "ml3.pyx":93
+ /* "ml3.pyx":92
* beta = max_beta
* # print n_nodes, n_roots, n_victims, max_i, roots
* return (beta, roots, ll) # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_roots); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_roots); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
- __pyx_t_3 = PyFloat_FromDouble(__pyx_v_ll); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyFloat_FromDouble(__pyx_v_ll); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_17);
__Pyx_GIVEREF(__pyx_t_17);
- PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
__pyx_t_5 = 0;
__pyx_t_17 = 0;
- __pyx_t_3 = 0;
+ __pyx_t_6 = 0;
__pyx_r = __pyx_t_16;
__pyx_t_16 = 0;
goto __pyx_L0;
@@ -5093,14 +5099,14 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "ml3.pyx":71
+ /* "ml3.pyx":70
* max_beta_add = float('-inf')
* # iterate over all victim nodes to find the optimal threshold
* for beta in np.arange(0.00001, 1., 1.): # <<<<<<<<<<<<<<
* thresh = log(beta/(3012.*(1.-beta)))
* seeds = isSeed==1
*/
- __pyx_tuple_ = PyTuple_Pack(3, __pyx_float_0_00001, __pyx_float_1_, __pyx_float_1_); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(3, __pyx_float_0_00001, __pyx_float_1_, __pyx_float_1_); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
@@ -5192,7 +5198,6 @@ static int __Pyx_InitGlobals(void) {
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
__pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_float_0_00001 = PyFloat_FromDouble(0.00001); if (unlikely(!__pyx_float_0_00001)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_float_neg_19_523275053840013 = PyFloat_FromDouble(-19.523275053840013); if (unlikely(!__pyx_float_neg_19_523275053840013)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
return 0;
@@ -6464,6 +6469,45 @@ static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t ori
return 1;
}
+static double __Pyx__PyObject_AsDouble(PyObject* obj) {
+ PyObject* float_value;
+#if CYTHON_COMPILING_IN_PYPY
+ float_value = PyNumber_Float(obj);
+#else
+ PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
+ if (likely(nb) && likely(nb->nb_float)) {
+ float_value = nb->nb_float(obj);
+ if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
+ PyErr_Format(PyExc_TypeError,
+ "__float__ returned non-float (type %.200s)",
+ Py_TYPE(float_value)->tp_name);
+ Py_DECREF(float_value);
+ goto bad;
+ }
+ } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
+#if PY_MAJOR_VERSION >= 3
+ float_value = PyFloat_FromString(obj);
+#else
+ float_value = PyFloat_FromString(obj, 0);
+#endif
+ } else {
+ PyObject* args = PyTuple_New(1);
+ if (unlikely(!args)) goto bad;
+ PyTuple_SET_ITEM(args, 0, obj);
+ float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
+ PyTuple_SET_ITEM(args, 0, 0);
+ Py_DECREF(args);
+ }
+#endif
+ if (likely(float_value)) {
+ double value = PyFloat_AS_DOUBLE(float_value);
+ Py_DECREF(float_value);
+ return value;
+ }
+bad:
+ return (double)-1;
+}
+
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
@@ -6542,45 +6586,6 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
-static double __Pyx__PyObject_AsDouble(PyObject* obj) {
- PyObject* float_value;
-#if CYTHON_COMPILING_IN_PYPY
- float_value = PyNumber_Float(obj);
-#else
- PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
- if (likely(nb) && likely(nb->nb_float)) {
- float_value = nb->nb_float(obj);
- if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
- PyErr_Format(PyExc_TypeError,
- "__float__ returned non-float (type %.200s)",
- Py_TYPE(float_value)->tp_name);
- Py_DECREF(float_value);
- goto bad;
- }
- } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
-#if PY_MAJOR_VERSION >= 3
- float_value = PyFloat_FromString(obj);
-#else
- float_value = PyFloat_FromString(obj, 0);
-#endif
- } else {
- PyObject* args = PyTuple_New(1);
- if (unlikely(!args)) goto bad;
- PyTuple_SET_ITEM(args, 0, obj);
- float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
- PyTuple_SET_ITEM(args, 0, 0);
- Py_DECREF(args);
- }
-#endif
- if (likely(float_value)) {
- double value = PyFloat_AS_DOUBLE(float_value);
- Py_DECREF(float_value);
- return value;
- }
-bad:
- return (double)-1;
-}
-
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject *tmp_type, *tmp_value, *tmp_tb;
diff --git a/experiments/ml3.pyx b/experiments/ml3.pyx
index faeda92..da993bc 100644
--- a/experiments/ml3.pyx
+++ b/experiments/ml3.pyx
@@ -6,7 +6,7 @@ from libc.math cimport log, exp
DTYPE = np.float64
ctypedef np.float_t DTYPE_t
-cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, DTYPE_t delta,
+cdef DTYPE_t weight_success(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta,
DTYPE_t w1, DTYPE_t w2, DTYPE_t w3):
"""weight for successful infection, exponential time model"""
cdef DTYPE_t structural, temporal, result
@@ -15,7 +15,7 @@ cdef DTYPE_t weight_success(int dist, int dt, DTYPE_t alpha, DTYPE_t delta,
result = log(structural) + temporal
return result
-cdef DTYPE_t weight_failure(int dist, int dt, DTYPE_t alpha, DTYPE_t delta,
+cdef DTYPE_t weight_failure(int dist, DTYPE_t dt, DTYPE_t alpha, DTYPE_t delta,
DTYPE_t w1, DTYPE_t w2, DTYPE_t w3):
"""weight for failed infection, exponential time model"""
cdef DTYPE_t structural, temporal, result
@@ -43,21 +43,20 @@ def ml3(dict root_victims, dict victims, dict non_victims, DTYPE_t age,
# for each victim node i, compute the probability that all its parents
# fail to infect it, also computes the probability that its most
# likely parent infects it
- failures = [weight_failure(dist, dt, alpha, delta, w1, w2, w3)
+ failures = [weight_failure(dist, dt/100., alpha, delta, w1, w2, w3)
for (dist, dt, w1, w2, w3) in parents]
probs_fail[i] = sum(failures)
- successes = [weight_success(dist, dt, alpha, delta, w1, w2, w3)
+ successes = [weight_success(dist, dt/100., alpha, delta, w1, w2, w3)
for (dist, dt, w1, w2, w3) in parents]
dists = [dist for (dist, dt, w1, w2, w3) in parents]
dts = [dt for (dist, dt, w1, w2, w3) in parents]
# find parent that maximizes log(p) - log(\tilde{p})
# probs[i] = max(s - failures[l] for l, s in enumerate(successes))
- # probs[i] = 0.
+ probs[i] = float("-inf")
for l, s in enumerate(successes):
prob = s - failures[l]
- if prob > -19.523275053840013:
- isSeed[i] = 0
- probs[i] += prob
+ if prob > probs[i]:
+ probs[i] = prob
parent_dists[i] = dists[l]
parent_dts[i] = dts[l]
# probs_fail[i] = failures[l]
diff --git a/experiments/ml3.so b/experiments/ml3.so
index 2dd1f2d..d2b6898 100755
--- a/experiments/ml3.so
+++ b/experiments/ml3.so
Binary files differ
diff --git a/experiments/out.log b/experiments/out.log
index b6cddf7..6ac961e 100644
--- a/experiments/out.log
+++ b/experiments/out.log
@@ -1,735 +1,225 @@
-0.03 0.09 0.1 8 -2524.16991366
-0.03 0.091 0.1 8 -2523.37447955
-0.03 0.092 0.1 8 -2522.66916324
-0.03 0.093 0.1 8 -2522.05302411
-0.03 0.094 0.1 8 -2521.52515842
-0.03 0.095 0.1 8 -2521.08469776
-0.03 0.096 0.1 8 -2520.73080755
-0.03 0.097 0.1 8 -2520.46268567
-0.03 0.098 0.1 8 -2520.27956114
-0.03 0.099 0.1 8 -2520.18069285
-0.03 0.1 0.1 8 -2520.16489903
-0.03 0.101 0.1 8 -2520.21363286
-0.03 0.102 0.1 8 -2520.34476449
-0.03 0.103 0.1 8 -2520.55765713
-0.03 0.104 0.1 8 -2520.85169858
-0.03 0.105 0.1 8 -2521.2263003
-0.03 0.106 0.1 8 -2521.68089651
-0.03 0.107 0.1 8 -2522.21494335
-0.03 0.108 0.1 8 -2522.82791806
-0.03 0.109 0.1 8 -2523.51931823
-0.03 0.11 0.1 8 -2524.28866105
-0.031 0.09 0.1 8 -2522.1436876
-0.031 0.091 0.1 8 -2521.35313396
-0.031 0.092 0.1 8 -2520.65274236
-0.031 0.093 0.1 8 -2520.02170745
-0.031 0.094 0.1 8 -2519.47855828
-0.031 0.095 0.1 8 -2519.02308655
-0.031 0.096 0.1 8 -2518.65445318
-0.031 0.097 0.1 8 -2518.37185167
-0.031 0.098 0.1 8 -2518.1745068
-0.031 0.099 0.1 8 -2518.06167338
-0.031 0.1 0.1 8 -2518.03263499
-0.031 0.101 0.1 8 -2518.08670293
-0.031 0.102 0.1 8 -2518.22321507
-0.031 0.103 0.1 8 -2518.44153485
-0.031 0.104 0.1 8 -2518.74105029
-0.031 0.105 0.1 8 -2519.12117307
-0.031 0.106 0.1 8 -2519.58133762
-0.031 0.107 0.1 8 -2520.12100029
-0.031 0.108 0.1 8 -2520.73963857
-0.031 0.109 0.1 8 -2521.43675024
-0.031 0.11 0.1 8 -2522.21185273
-0.032 0.09 0.1 8 -2520.29066878
-0.032 0.091 0.1 8 -2519.48374789
-0.032 0.092 0.1 8 -2518.76727387
-0.032 0.093 0.1 8 -2518.14030131
-0.032 0.094 0.1 8 -2517.60192185
-0.032 0.095 0.1 8 -2517.15126258
-0.032 0.096 0.1 8 -2516.78748463
-0.032 0.097 0.1 8 -2516.50978171
-0.032 0.098 0.1 8 -2516.3173788
-0.032 0.099 0.1 8 -2516.20953091
-0.032 0.1 0.1 8 -2516.18552186
-0.032 0.101 0.1 8 -2516.24466312
-0.032 0.102 0.1 8 -2516.38629278
-0.032 0.103 0.1 8 -2516.60977448
-0.032 0.104 0.1 8 -2516.91449646
-0.032 0.105 0.1 8 -2517.2998706
-0.032 0.106 0.1 8 -2517.76533154
-0.032 0.107 0.1 8 -2518.31033586
-0.032 0.108 0.1 8 -2518.93436121
-0.032 0.109 0.1 8 -2519.63690563
-0.032 0.11 0.1 8 -2520.41748673
-0.033 0.09 0.1 8 -2518.6656139
-0.033 0.091 0.1 8 -2517.8631188
-0.033 0.092 0.1 8 -2517.15111081
-0.033 0.093 0.1 8 -2516.52864471
-0.033 0.094 0.1 8 -2515.99481231
-0.033 0.095 0.1 8 -2515.54874094
-0.033 0.096 0.1 8 -2515.1895919
-0.033 0.097 0.1 8 -2514.91655909
-0.033 0.098 0.1 8 -2514.72886771
-0.033 0.099 0.1 8 -2514.62577295
-0.033 0.1 0.1 8 -2514.60655882
-0.033 0.101 0.1 8 -2514.670537
-0.033 0.102 0.1 8 -2514.81704578
-0.033 0.103 0.1 8 -2515.04544899
-0.033 0.104 0.1 8 -2515.35513507
-0.033 0.105 0.1 8 -2515.7455161
-0.033 0.106 0.1 8 -2516.21602692
-0.033 0.107 0.1 8 -2516.76612429
-0.033 0.108 0.1 8 -2517.39528608
-0.033 0.109 0.1 8 -2518.09594913
-0.033 0.11 0.1 8 -2518.86459803
-0.034 0.09 0.1 8 -2517.29524031
-0.034 0.091 0.1 8 -2516.49697398
-0.034 0.092 0.1 8 -2515.78923326
-0.034 0.093 0.1 8 -2515.1710731
-0.034 0.094 0.1 8 -2514.64158553
-0.034 0.095 0.1 8 -2514.19989803
-0.034 0.096 0.1 8 -2513.8451721
-0.034 0.097 0.1 8 -2513.57660184
-0.034 0.098 0.1 8 -2513.39341262
-0.034 0.099 0.1 8 -2513.29485983
-0.034 0.1 0.1 8 -2513.28022765
-0.034 0.101 0.1 8 -2513.34754019
-0.034 0.102 0.1 8 -2513.48010785
-0.034 0.103 0.1 8 -2513.69480394
-0.034 0.104 0.1 8 -2513.99101336
-0.034 0.105 0.1 8 -2514.36814478
-0.034 0.106 0.1 8 -2514.82562974
-0.034 0.107 0.1 8 -2515.36292177
-0.034 0.108 0.1 8 -2515.97949564
-0.034 0.109 0.1 8 -2516.67484652
-0.034 0.11 0.1 8 -2517.44848931
-0.035 0.09 0.1 8 -2516.1651594
-0.035 0.091 0.1 8 -2515.37094245
-0.035 0.092 0.1 8 -2514.66728801
-0.035 0.093 0.1 8 -2514.05325122
-0.035 0.094 0.1 8 -2513.52473289
-0.035 0.095 0.1 8 -2513.0671733
-0.035 0.096 0.1 8 -2512.6968357
-0.035 0.097 0.1 8 -2512.41290979
-0.035 0.098 0.1 8 -2512.21461666
-0.035 0.099 0.1 8 -2512.10120756
-0.035 0.1 0.1 8 -2512.07196269
-0.035 0.101 0.1 8 -2512.12619003
-0.035 0.102 0.1 8 -2512.2632243
-0.035 0.103 0.1 8 -2512.48242589
-0.035 0.104 0.1 8 -2512.78317988
-0.035 0.105 0.1 8 -2513.16489511
-0.035 0.106 0.1 8 -2513.6270033
-0.035 0.107 0.1 8 -2514.16895818
-0.035 0.108 0.1 8 -2514.79023467
-0.035 0.109 0.1 8 -2515.49032815
-0.035 0.11 0.1 8 -2516.26875369
-0.036 0.09 0.1 8 -2515.20368243
-0.036 0.091 0.1 8 -2514.39234197
-0.036 0.092 0.1 8 -2513.67184218
-0.036 0.093 0.1 8 -2513.04123316
-0.036 0.094 0.1 8 -2512.49960224
-0.036 0.095 0.1 8 -2512.04607234
-0.036 0.096 0.1 8 -2511.67980059
-0.036 0.097 0.1 8 -2511.39997684
-0.036 0.098 0.1 8 -2511.20582236
-0.036 0.099 0.1 8 -2511.09658858
-0.036 0.1 0.1 8 -2511.07155586
-0.036 0.101 0.1 8 -2511.13003236
-0.036 0.102 0.1 8 -2511.27135296
-0.036 0.103 0.1 8 -2511.49487824
-0.036 0.104 0.1 8 -2511.79999344
-0.036 0.105 0.1 8 -2512.18610758
-0.036 0.106 0.1 8 -2512.65265255
-0.036 0.107 0.1 8 -2513.19908225
-0.036 0.108 0.1 8 -2513.82487179
-0.036 0.109 0.1 8 -2514.5295167
-0.036 0.11 0.1 8 -2515.31253224
-0.037 0.09 0.1 8 -2514.37772701
-0.037 0.091 0.1 8 -2513.57012341
-0.037 0.092 0.1 8 -2512.85339461
-0.037 0.093 0.1 8 -2512.22659089
-0.037 0.094 0.1 8 -2511.68879971
-0.037 0.095 0.1 8 -2511.2391442
-0.037 0.096 0.1 8 -2510.87678162
-0.037 0.097 0.1 8 -2510.600902
-0.037 0.098 0.1 8 -2510.41072677
-0.037 0.099 0.1 8 -2510.30550753
-0.037 0.1 0.1 8 -2510.28452479
-0.037 0.101 0.1 8 -2510.34708689
-0.037 0.102 0.1 8 -2510.49252888
-0.037 0.103 0.1 8 -2510.72021148
-0.037 0.104 0.1 8 -2511.02952013
-0.037 0.105 0.1 8 -2511.41986399
-0.037 0.106 0.1 8 -2511.89067512
-0.037 0.107 0.1 8 -2512.4414076
-0.037 0.108 0.1 8 -2513.07153669
-0.037 0.109 0.1 8 -2513.77649295
-0.037 0.11 0.1 8 -2514.54676597
-0.038 0.09 0.1 8 -2513.75551416
-0.038 0.091 0.1 8 -2512.9515099
-0.038 0.092 0.1 8 -2512.23841337
-0.038 0.093 0.1 8 -2511.61527499
-0.038 0.094 0.1 8 -2511.08118239
-0.038 0.095 0.1 8 -2510.63525883
-0.038 0.096 0.1 8 -2510.27666175
-0.038 0.097 0.1 8 -2510.00458134
-0.038 0.098 0.1 8 -2509.81823917
-0.038 0.099 0.1 8 -2509.71688701
-0.038 0.1 0.1 8 -2509.69980554
-0.038 0.101 0.1 8 -2509.76630324
-0.038 0.102 0.1 8 -2509.91380565
-0.038 0.103 0.1 8 -2510.12708255
-0.038 0.104 0.1 8 -2510.42221002
-0.038 0.105 0.1 8 -2510.7985938
-0.038 0.106 0.1 8 -2511.25566261
-0.038 0.107 0.1 8 -2511.79286726
-0.038 0.108 0.1 8 -2512.40967988
-0.038 0.109 0.1 8 -2513.10559312
-0.038 0.11 0.1 8 -2513.88011942
-0.039 0.09 0.1 8 -2513.32670083
-0.039 0.091 0.1 8 -2512.52616955
-0.039 0.092 0.1 8 -2511.81657779
-0.039 0.093 0.1 8 -2511.19697611
-0.039 0.094 0.1 8 -2510.6664523
-0.039 0.095 0.1 8 -2510.22412979
-0.039 0.096 0.1 8 -2509.85902971
-0.039 0.097 0.1 8 -2509.57098573
-0.039 0.098 0.1 8 -2509.36892646
-0.039 0.099 0.1 8 -2509.25209949
-0.039 0.1 0.1 8 -2509.21978147
-0.039 0.101 0.1 8 -2509.271277
-0.039 0.102 0.1 8 -2509.40591748
-0.039 0.103 0.1 8 -2509.62306014
-0.039 0.104 0.1 8 -2509.92208699
-0.039 0.105 0.1 8 -2510.30240394
-0.039 0.106 0.1 8 -2510.76343984
-0.039 0.107 0.1 8 -2511.30464566
-0.039 0.108 0.1 8 -2511.9254937
-0.039 0.109 0.1 8 -2512.62547675
-0.039 0.11 0.1 8 -2513.40410741
-0.04 0.09 0.1 8 -2513.07118967
-0.04 0.091 0.1 8 -2512.25300533
-0.04 0.092 0.1 8 -2511.52603397
-0.04 0.093 0.1 8 -2510.88932107
-0.04 0.094 0.1 8 -2510.34194951
-0.04 0.095 0.1 8 -2509.88303797
-0.04 0.096 0.1 8 -2509.51173945
-0.04 0.097 0.1 8 -2509.22723982
-0.04 0.098 0.1 8 -2509.02875655
-0.04 0.099 0.1 8 -2508.91553735
-0.04 0.1 0.1 8 -2508.88685903
-0.04 0.101 0.1 8 -2508.94202633
-0.04 0.102 0.1 8 -2509.08037081
-0.04 0.103 0.1 8 -2509.30124984
-0.04 0.104 0.1 8 -2509.60404559
-0.04 0.105 0.1 8 -2509.98816409
-0.04 0.106 0.1 8 -2510.45303437
-0.04 0.107 0.1 8 -2510.99810753
-0.04 0.108 0.1 8 -2511.62285602
-0.04 0.109 0.1 8 -2512.32677279
-0.04 0.11 0.1 8 -2513.10937058
-0.041 0.09 0.1 8 -2512.87821495
-0.041 0.091 0.1 8 -2512.06328062
-0.041 0.092 0.1 8 -2511.33958904
-0.041 0.093 0.1 8 -2510.70618587
-0.041 0.094 0.1 8 -2510.16215411
-0.041 0.095 0.1 8 -2509.7066126
-0.041 0.096 0.1 8 -2509.33871445
-0.041 0.097 0.1 8 -2509.0576457
-0.041 0.098 0.1 8 -2508.86262395
-0.041 0.099 0.1 8 -2508.75289706
-0.041 0.1 0.1 8 -2508.72774197
-0.041 0.101 0.1 8 -2508.78646358
-0.041 0.102 0.1 8 -2508.92839358
-0.041 0.103 0.1 8 -2509.15288948
-0.041 0.104 0.1 8 -2509.4593336
-0.041 0.105 0.1 8 -2509.84713212
-0.041 0.106 0.1 8 -2510.31571419
-0.041 0.107 0.1 8 -2510.86453109
-0.041 0.108 0.1 8 -2511.49305538
-0.041 0.109 0.1 8 -2512.19670995
-0.041 0.11 0.1 8 -2512.96597014
-0.042 0.09 0.1 8 -2512.85190719
-0.042 0.091 0.1 8 -2512.04012324
-0.042 0.092 0.1 8 -2511.31961094
-0.042 0.093 0.1 8 -2510.68941609
-0.042 0.094 0.1 8 -2510.14862183
-0.042 0.095 0.1 8 -2509.69634712
-0.042 0.096 0.1 8 -2509.33174523
-0.042 0.097 0.1 8 -2509.05400233
-0.042 0.098 0.1 8 -2508.86233614
-0.042 0.099 0.1 8 -2508.75599468
-0.042 0.1 0.1 8 -2508.73425502
-0.042 0.101 0.1 8 -2508.79642219
-0.042 0.102 0.1 8 -2508.94182803
-0.042 0.103 0.1 8 -2509.16148888
-0.042 0.104 0.1 8 -2509.4532293
-0.042 0.105 0.1 8 -2509.82654034
-0.042 0.106 0.1 8 -2510.28084781
-0.042 0.107 0.1 8 -2510.81559968
-0.042 0.108 0.1 8 -2511.43026537
-0.042 0.109 0.1 8 -2512.12433489
-0.042 0.11 0.1 8 -2512.89731812
-0.043 0.09 0.1 8 -2512.98457584
-0.043 0.091 0.1 8 -2512.17584986
-0.043 0.092 0.1 8 -2511.45842361
-0.043 0.093 0.1 8 -2510.831343
-0.043 0.094 0.1 8 -2510.29369133
-0.043 0.095 0.1 8 -2509.84458768
-0.043 0.096 0.1 8 -2509.48318545
-0.043 0.097 0.1 8 -2509.20287919
-0.043 0.098 0.1 8 -2508.99503678
-0.043 0.099 0.1 8 -2508.872757
-0.043 0.1 0.1 8 -2508.83531288
-0.043 0.101 0.1 8 -2508.88200549
-0.043 0.102 0.1 8 -2509.01216288
-0.043 0.103 0.1 8 -2509.225139
-0.043 0.104 0.1 8 -2509.52031271
-0.043 0.105 0.1 8 -2509.89708686
-0.043 0.106 0.1 8 -2510.35488737
-0.043 0.107 0.1 8 -2510.89316237
-0.043 0.108 0.1 8 -2511.51138139
-0.043 0.109 0.1 8 -2512.19797802
-0.043 0.11 0.1 8 -2512.95741925
-0.044 0.09 0.1 8 -2513.26904731
-0.044 0.091 0.1 8 -2512.46329338
-0.044 0.092 0.1 8 -2511.73253181
-0.044 0.093 0.1 8 -2511.08793241
-0.044 0.094 0.1 8 -2510.53302141
-0.044 0.095 0.1 8 -2510.06691314
-0.044 0.096 0.1 8 -2509.68875637
-0.044 0.097 0.1 8 -2509.39773295
-0.044 0.098 0.1 8 -2509.19305641
-0.044 0.099 0.1 8 -2509.07397069
-0.044 0.1 0.1 8 -2509.03974897
-0.044 0.101 0.1 8 -2509.08969245
-0.044 0.102 0.1 8 -2509.2231293
-0.044 0.103 0.1 8 -2509.42908303
-0.044 0.104 0.1 8 -2509.70937281
-0.044 0.105 0.1 8 -2510.07147812
-0.044 0.106 0.1 8 -2510.51482152
-0.044 0.107 0.1 8 -2511.03884786
-0.044 0.108 0.1 8 -2511.6430235
-0.044 0.109 0.1 8 -2512.3268355
-0.044 0.11 0.1 8 -2513.08979087
-0.045 0.09 0.1 8 -2513.61309217
-0.045 0.091 0.1 8 -2512.78920547
-0.045 0.092 0.1 8 -2512.05691459
-0.045 0.093 0.1 8 -2511.41526046
-0.045 0.094 0.1 8 -2510.86332156
-0.045 0.095 0.1 8 -2510.40021234
-0.045 0.096 0.1 8 -2510.02508171
-0.045 0.097 0.1 8 -2509.7343223
-0.045 0.098 0.1 8 -2509.51331026
-0.045 0.099 0.1 8 -2509.37812595
-0.045 0.1 0.1 8 -2509.32803847
-0.045 0.101 0.1 8 -2509.3623451
-0.045 0.102 0.1 8 -2509.4803702
-0.045 0.103 0.1 8 -2509.68146414
-0.045 0.104 0.1 8 -2509.96500234
-0.045 0.105 0.1 8 -2510.3303843
-0.045 0.106 0.1 8 -2510.77703268
-0.045 0.107 0.1 8 -2511.30439248
-0.045 0.108 0.1 8 -2511.91193017
-0.045 0.109 0.1 8 -2512.59913295
-0.045 0.11 0.1 8 -2513.36550797
-0.046 0.09 0.1 8 -2514.07049386
-0.046 0.091 0.1 8 -2513.24942436
-0.046 0.092 0.1 8 -2512.51164807
-0.046 0.093 0.1 8 -2511.85233317
-0.046 0.094 0.1 8 -2511.28299208
-0.046 0.095 0.1 8 -2510.80273447
-0.046 0.096 0.1 8 -2510.41070465
-0.046 0.097 0.1 8 -2510.10608009
-0.046 0.098 0.1 8 -2509.88807014
-0.046 0.099 0.1 8 -2509.75591467
-0.046 0.1 0.1 8 -2509.70888293
-0.046 0.101 0.1 8 -2509.74627229
-0.046 0.102 0.1 8 -2509.86740725
-0.046 0.103 0.1 8 -2510.07163831
-0.046 0.104 0.1 8 -2510.35834101
-0.046 0.105 0.1 8 -2510.72691496
-0.046 0.106 0.1 8 -2511.17678296
-0.046 0.107 0.1 8 -2511.70739013
-0.046 0.108 0.1 8 -2512.31820305
-0.046 0.109 0.1 8 -2513.00870905
-0.046 0.11 0.1 8 -2513.77841541
-0.047 0.09 0.1 8 -2514.58836976
-0.047 0.091 0.1 8 -2513.74903825
-0.047 0.092 0.1 8 -2513.00159644
-0.047 0.093 0.1 8 -2512.34508028
-0.047 0.094 0.1 8 -2511.77856343
-0.047 0.095 0.1 8 -2511.30115571
-0.047 0.096 0.1 8 -2510.91200151
-0.047 0.097 0.1 8 -2510.61027845
-0.047 0.098 0.1 8 -2510.39519599
-0.047 0.099 0.1 8 -2510.26599412
-0.047 0.1 0.1 8 -2510.22194219
-0.047 0.101 0.1 8 -2510.26233773
-0.047 0.102 0.1 8 -2510.38650532
-0.047 0.103 0.1 8 -2510.5937956
-0.047 0.104 0.1 8 -2510.88358422
-0.047 0.105 0.1 8 -2511.25527092
-0.047 0.106 0.1 8 -2511.70827862
-0.047 0.107 0.1 8 -2512.24205253
-0.047 0.108 0.1 8 -2512.8560594
-0.047 0.109 0.1 8 -2513.54978665
-0.047 0.11 0.1 8 -2514.32274169
-0.048 0.09 0.1 8 -2515.20022791
-0.048 0.091 0.1 8 -2514.3635787
-0.048 0.092 0.1 8 -2513.61884388
-0.048 0.093 0.1 8 -2512.96505949
-0.048 0.094 0.1 8 -2512.40129935
-0.048 0.095 0.1 8 -2511.92667334
-0.048 0.096 0.1 8 -2511.54032601
-0.048 0.097 0.1 8 -2511.24143509
-0.048 0.098 0.1 8 -2511.02921012
-0.048 0.099 0.1 8 -2510.90289125
-0.048 0.1 0.1 8 -2510.86174793
-0.048 0.101 0.1 8 -2510.9050778
-0.048 0.102 0.1 8 -2511.03220556
-0.048 0.103 0.1 8 -2511.24248197
-0.048 0.104 0.1 8 -2511.53528279
-0.048 0.105 0.1 8 -2511.91000789
-0.048 0.106 0.1 8 -2512.36608029
-0.048 0.107 0.1 8 -2512.90294534
-0.048 0.108 0.1 8 -2513.52006988
-0.048 0.109 0.1 8 -2514.21694146
-0.048 0.11 0.1 8 -2514.9930676
-0.049 0.09 0.1 8 -2515.93433667
-0.049 0.091 0.1 8 -2515.10030794
-0.049 0.092 0.1 8 -2514.35821771
-0.049 0.093 0.1 8 -2513.70710217
-0.049 0.094 0.1 8 -2513.14603521
-0.049 0.095 0.1 8 -2512.67412685
-0.049 0.096 0.1 8 -2512.29052174
-0.049 0.097 0.1 8 -2511.99439772
-0.049 0.098 0.1 8 -2511.78496447
-0.049 0.099 0.1 8 -2511.66146222
-0.049 0.1 0.1 8 -2511.62316054
-0.049 0.101 0.1 8 -2511.66935719
-0.049 0.102 0.1 8 -2511.799377
-0.049 0.103 0.1 8 -2512.01257081
-0.049 0.104 0.1 8 -2512.30831453
-0.049 0.105 0.1 8 -2512.6860081
-0.049 0.106 0.1 8 -2513.1450747
-0.049 0.107 0.1 8 -2513.68495976
-0.049 0.108 0.1 8 -2514.30513026
-0.049 0.109 0.1 8 -2515.00507385
-0.049 0.11 0.1 8 -2515.78429816
-0.05 0.09 0.1 8 -2516.78582212
-0.05 0.091 0.1 8 -2515.95435563
-0.05 0.092 0.1 8 -2515.21485123
-0.05 0.093 0.1 8 -2514.56634522
-0.05 0.094 0.1 8 -2514.00791161
-0.05 0.095 0.1 8 -2513.53866053
-0.05 0.096 0.1 8 -2513.15773673
-0.05 0.097 0.1 8 -2512.86431817
-0.05 0.098 0.1 8 -2512.65761463
-0.05 0.099 0.1 8 -2512.53686646
-0.05 0.1 0.1 8 -2512.50134334
-0.05 0.101 0.1 8 -2512.55034314
-0.05 0.102 0.1 8 -2512.68319079
-0.05 0.103 0.1 8 -2512.89923726
-0.05 0.104 0.1 8 -2513.19785855
-0.05 0.105 0.1 8 -2513.57845473
-0.05 0.106 0.1 8 -2514.04044908
-0.05 0.107 0.1 8 -2514.58328715
-0.05 0.108 0.1 8 -2515.20643602
-0.05 0.109 0.1 8 -2515.90938346
-0.05 0.11 0.1 8 -2516.69163722
-0.051 0.09 0.1 8 -2517.75009328
-0.051 0.091 0.1 8 -2516.92113404
-0.051 0.092 0.1 8 -2516.18415999
-0.051 0.093 0.1 8 -2515.53820753
-0.051 0.094 0.1 8 -2514.98235078
-0.051 0.095 0.1 8 -2514.51569998
-0.051 0.096 0.1 8 -2514.13739999
-0.051 0.097 0.1 8 -2513.84662887
-0.051 0.098 0.1 8 -2513.64259651
-0.051 0.099 0.1 8 -2513.52454338
-0.051 0.1 0.1 8 -2513.49173925
-0.051 0.101 0.1 8 -2513.5434821
-0.051 0.102 0.1 8 -2513.67909698
-0.051 0.103 0.1 8 -2513.89793497
-0.051 0.104 0.1 8 -2514.19937217
-0.051 0.105 0.1 8 -2514.58280876
-0.051 0.106 0.1 8 -2515.04766812
-0.051 0.107 0.1 8 -2515.59339593
-0.051 0.108 0.1 8 -2516.21945936
-0.051 0.109 0.1 8 -2516.92534631
-0.051 0.11 0.1 8 -2517.71056461
-0.052 0.09 0.1 8 -2518.82282066
-0.052 0.091 0.1 8 -2517.99631666
-0.052 0.092 0.1 8 -2517.26182047
-0.052 0.093 0.1 8 -2516.6183686
-0.052 0.094 0.1 8 -2516.06503527
-0.052 0.095 0.1 8 -2515.60093083
-0.052 0.096 0.1 8 -2515.22520025
-0.052 0.097 0.1 8 -2514.93702168
-0.052 0.098 0.1 8 -2514.73560513
-0.052 0.099 0.1 8 -2514.62019116
-0.052 0.1 0.1 8 -2514.59004967
-0.052 0.101 0.1 8 -2514.64447873
-0.052 0.102 0.1 8 -2514.7828035
-0.052 0.103 0.1 8 -2515.00437516
-0.052 0.104 0.1 8 -2515.30856992
-0.052 0.105 0.1 8 -2515.69478807
-0.052 0.106 0.1 8 -2516.16245309
-0.052 0.107 0.1 8 -2516.71101077
-0.052 0.108 0.1 8 -2517.33992839
-0.052 0.109 0.1 8 -2518.04869395
-0.052 0.11 0.1 8 -2518.8368154
-0.053 0.09 0.1 8 -2519.9999168
-0.053 0.091 0.1 8 -2519.17581874
-0.053 0.092 0.1 8 -2518.44375066
-0.053 0.093 0.1 8 -2517.80274917
-0.053 0.094 0.1 8 -2517.25188861
-0.053 0.095 0.1 8 -2516.79027942
-0.053 0.096 0.1 8 -2516.41706668
-0.053 0.097 0.1 8 -2516.13142863
-0.053 0.098 0.1 8 -2515.9325754
-0.053 0.099 0.1 8 -2515.81974765
-0.053 0.1 0.1 8 -2515.79221537
-0.053 0.101 0.1 8 -2515.84927675
-0.053 0.102 0.1 8 -2515.99025704
-0.053 0.103 0.1 8 -2516.21450753
-0.053 0.104 0.1 8 -2516.52140454
-0.053 0.105 0.1 8 -2516.91034846
-0.053 0.106 0.1 8 -2517.38076288
-0.053 0.107 0.1 8 -2517.93209367
-0.053 0.108 0.1 8 -2518.56380825
-0.053 0.109 0.1 8 -2519.27539469
-0.053 0.11 0.1 8 -2520.06636107
-0.054 0.09 0.1 8 -2521.27751863
-0.054 0.091 0.1 8 -2520.45577967
-0.054 0.092 0.1 8 -2519.72609245
-0.054 0.093 0.1 8 -2519.08749368
-0.054 0.094 0.1 8 -2518.53905778
-0.054 0.095 0.1 8 -2518.0798953
-0.054 0.096 0.1 8 -2517.70915141
-0.054 0.097 0.1 8 -2517.42600448
-0.054 0.098 0.1 8 -2517.22966471
-0.054 0.099 0.1 8 -2517.11937287
-0.054 0.1 0.1 8 -2517.09439907
-0.054 0.101 0.1 8 -2517.15404158
-0.054 0.102 0.1 8 -2517.29762577
-0.054 0.103 0.1 8 -2517.52450301
-0.054 0.104 0.1 8 -2517.83404973
-0.054 0.105 0.1 8 -2518.22566643
-0.054 0.106 0.1 8 -2518.69877679
-0.054 0.107 0.1 8 -2519.2528268
-0.054 0.108 0.1 8 -2519.88728395
-0.054 0.109 0.1 8 -2520.60163645
-0.054 0.11 0.1 8 -2521.39539246
-0.055 0.09 0.1 8 -2522.65197134
-0.055 0.091 0.1 8 -2521.83254695
-0.055 0.092 0.1 8 -2521.10519564
-0.055 0.093 0.1 8 -2520.46895421
-0.055 0.094 0.1 8 -2519.92289719
-0.055 0.095 0.1 8 -2519.46613523
-0.055 0.096 0.1 8 -2519.0978136
-0.055 0.097 0.1 8 -2518.81711076
-0.055 0.098 0.1 8 -2518.62323702
-0.055 0.099 0.1 8 -2518.51543324
-0.055 0.1 0.1 8 -2518.49296963
-0.055 0.101 0.1 8 -2518.55514457
-0.055 0.102 0.1 8 -2518.70128351
-0.055 0.103 0.1 8 -2518.93073794
-0.055 0.104 0.1 8 -2519.24288438
-0.055 0.105 0.1 8 -2519.63712343
-0.055 0.106 0.1 8 -2520.11287888
-0.055 0.107 0.1 8 -2520.6695968
-0.055 0.108 0.1 8 -2521.30674481
-0.055 0.109 0.1 8 -2522.02381118
-0.055 0.11 0.1 8 -2522.82030421
-0.056 0.09 0.1 8 -2524.1198138
-0.056 0.091 0.1 8 -2523.30266151
-0.056 0.092 0.1 8 -2522.57760324
-0.056 0.093 0.1 8 -2521.94367592
-0.056 0.094 0.1 8 -2521.39995415
-0.056 0.095 0.1 8 -2520.94554868
-0.056 0.096 0.1 8 -2520.57960488
-0.056 0.097 0.1 8 -2520.30130131
-0.056 0.098 0.1 8 -2520.10984838
-0.056 0.099 0.1 8 -2520.00448704
-0.056 0.1 0.1 8 -2519.9844876
-0.056 0.101 0.1 8 -2520.04914853
-0.056 0.102 0.1 8 -2520.19779539
-0.056 0.103 0.1 8 -2520.42977976
-0.056 0.104 0.1 8 -2520.74447826
-0.056 0.105 0.1 8 -2521.1412916
-0.056 0.106 0.1 8 -2521.61964363
-0.056 0.107 0.1 8 -2522.17898057
-0.056 0.108 0.1 8 -2522.8187701
-0.056 0.109 0.1 8 -2523.53850061
-0.056 0.11 0.1 8 -2524.33768048
-0.057 0.09 0.1 8 -2525.67776511
-0.057 0.091 0.1 8 -2524.86284436
-0.057 0.092 0.1 8 -2524.14003823
-0.057 0.093 0.1 8 -2523.50838372
-0.057 0.094 0.1 8 -2522.96695553
-0.057 0.095 0.1 8 -2522.51486451
-0.057 0.096 0.1 8 -2522.15125612
-0.057 0.097 0.1 8 -2521.87530902
-0.057 0.098 0.1 8 -2521.68623371
-0.057 0.099 0.1 8 -2521.58327124
-0.057 0.1 0.1 8 -2521.56569201
-0.057 0.101 0.1 8 -2521.6327946
-0.057 0.102 0.1 8 -2521.78390465
-0.057 0.103 0.1 8 -2522.01837384
-0.057 0.104 0.1 8 -2522.3355789
-0.057 0.105 0.1 8 -2522.7349206
-0.057 0.106 0.1 8 -2523.21582293
-0.057 0.107 0.1 8 -2523.77773218
-0.057 0.108 0.1 8 -2524.42011612
-0.057 0.109 0.1 8 -2525.14246327
-0.057 0.11 0.1 8 -2525.94428207
-0.058 0.09 0.1 8 -2527.32271238
-0.058 0.091 0.1 8 -2526.5099844
-0.058 0.092 0.1 8 -2525.78939126
-0.058 0.093 0.1 8 -2525.15997006
-0.058 0.094 0.1 8 -2524.6207956
-0.058 0.095 0.1 8 -2524.17097881
-0.058 0.096 0.1 8 -2523.80966526
-0.058 0.097 0.1 8 -2523.53603368
-0.058 0.098 0.1 8 -2523.34929469
-0.058 0.099 0.1 8 -2523.24868942
-0.058 0.1 0.1 8 -2523.23348836
-0.058 0.101 0.1 8 -2523.30299018
-0.058 0.102 0.1 8 -2523.45652064
-0.058 0.103 0.1 8 -2523.69343149
-0.058 0.104 0.1 8 -2524.01309955
-0.058 0.105 0.1 8 -2524.41492571
-0.058 0.106 0.1 8 -2524.89833404
-0.058 0.107 0.1 8 -2525.46277092
-0.058 0.108 0.1 8 -2526.10770422
-0.058 0.109 0.1 8 -2526.83262255
-0.058 0.11 0.1 8 -2527.63703446
-0.059 0.09 0.1 8 -2529.05169951
-0.059 0.091 0.1 8 -2528.24112714
-0.059 0.092 0.1 8 -2527.52270949
-0.059 0.093 0.1 8 -2526.89548376
-0.059 0.094 0.1 8 -2526.35852484
-0.059 0.095 0.1 8 -2525.91094376
-0.059 0.096 0.1 8 -2525.55188616
-0.059 0.097 0.1 8 -2525.28053089
-0.059 0.098 0.1 8 -2525.09608863
-0.059 0.099 0.1 8 -2524.99780063
-0.059 0.1 0.1 8 -2524.98493746
-0.059 0.101 0.1 8 -2525.05679789
-0.059 0.102 0.1 8 -2525.21270775
-0.059 0.103 0.1 8 -2525.4520189
-0.059 0.104 0.1 8 -2525.77410826
-0.059 0.105 0.1 8 -2526.1783768
-0.059 0.106 0.1 8 -2526.66424868
-0.059 0.107 0.1 8 -2527.23117038
-0.059 0.108 0.1 8 -2527.87860987
-0.059 0.109 0.1 8 -2528.60605584
-0.059 0.11 0.1 8 -2529.41301693
-0.06 0.09 0.1 8 -2530.86191689
-0.06 0.091 0.1 8 -2530.05346447
-0.06 0.092 0.1 8 -2529.33718634
-0.06 0.093 0.1 8 -2528.71211977
-0.06 0.094 0.1 8 -2528.17733975
-0.06 0.095 0.1 8 -2527.7319574
-0.06 0.096 0.1 8 -2527.37511845
-0.06 0.097 0.1 8 -2527.10600184
-0.06 0.098 0.1 8 -2526.92381834
-0.06 0.099 0.1 8 -2526.82780929
-0.06 0.1 0.1 8 -2526.81724535
-0.06 0.101 0.1 8 -2526.89142538
-0.06 0.102 0.1 8 -2527.0496753
-0.06 0.103 0.1 8 -2527.29134708
-0.06 0.104 0.1 8 -2527.6158177
-0.06 0.105 0.1 8 -2528.02248823
-0.06 0.106 0.1 8 -2528.51078293
-0.06 0.107 0.1 8 -2529.08014837
-0.06 0.108 0.1 8 -2529.73005261
-0.06 0.109 0.1 8 -2530.45998443
-0.06 0.11 0.1 8 -2531.26945256
-0.061 0.09 0.1 8 -2532.75069192
-0.061 0.091 0.1 8 -2531.94432519
-0.061 0.092 0.1 8 -2531.23015199
-0.061 0.093 0.1 8 -2530.60720969
-0.061 0.094 0.1 8 -2530.07457336
-0.061 0.095 0.1 8 -2529.6313542
-0.061 0.096 0.1 8 -2529.27669805
-0.061 0.097 0.1 8 -2529.00978393
-0.061 0.098 0.1 8 -2528.82982269
-0.061 0.099 0.1 8 -2528.73605576
-0.061 0.1 0.1 8 -2528.7277539
-0.061 0.101 0.1 8 -2528.80421605
-0.061 0.102 0.1 8 -2528.96476823
-0.061 0.103 0.1 8 -2529.20876248
-0.061 0.104 0.1 8 -2529.53557589
-0.061 0.105 0.1 8 -2529.94460961
-0.061 0.106 0.1 8 -2530.43528799
-0.061 0.107 0.1 8 -2531.00705769
-0.061 0.108 0.1 8 -2531.65938685
-0.061 0.109 0.1 8 -2532.39176436
-0.061 0.11 0.1 8 -2533.20369902
-0.062 0.09 0.1 8 -2534.71548033
-0.062 0.091 0.1 8 -2533.91116631
-0.062 0.092 0.1 8 -2533.19906476
-0.062 0.093 0.1 8 -2532.57821314
-0.062 0.094 0.1 8 -2532.04768661
-0.062 0.095 0.1 8 -2531.60659646
-0.062 0.096 0.1 8 -2531.25408859
-0.062 0.097 0.1 8 -2530.98934213
-0.062 0.098 0.1 8 -2530.81156803
-0.062 0.099 0.1 8 -2530.72000778
-0.062 0.1 0.1 8 -2530.71393224
-0.062 0.101 0.1 8 -2530.79264044
-0.062 0.102 0.1 8 -2530.95545849
-0.062 0.103 0.1 8 -2531.2017385
-0.062 0.104 0.1 8 -2531.53085767
-0.062 0.105 0.1 8 -2531.94221722
-0.062 0.106 0.1 8 -2532.4352416
-0.062 0.107 0.1 8 -2533.00937756
-0.062 0.108 0.1 8 -2533.66409332
-0.062 0.109 0.1 8 -2534.39887785
-0.062 0.11 0.1 8 -2535.21324007
-0.063 0.09 0.1 8 -2536.75385809
-0.063 0.091 0.1 8 -2535.95156501
-0.063 0.092 0.1 8 -2535.24150304
-0.063 0.093 0.1 8 -2534.62270974
-0.063 0.094 0.1 8 -2534.09426034
-0.063 0.095 0.1 8 -2533.65526623
-0.063 0.096 0.1 8 -2533.30487341
-0.063 0.097 0.1 8 -2533.04226106
-0.063 0.098 0.1 8 -2532.86664023
-0.063 0.099 0.1 8 -2532.77725251
-0.063 0.1 0.1 8 -2532.77336883
-0.063 0.101 0.1 8 -2532.85428831
-0.063 0.102 0.1 8 -2533.01933715
-0.063 0.103 0.1 8 -2533.26786755
-0.063 0.104 0.1 8 -2533.59925678
-0.063 0.105 0.1 8 -2534.01290617
-0.063 0.106 0.1 8 -2534.50824024
-0.063 0.107 0.1 8 -2535.08470582
-0.063 0.108 0.1 8 -2535.73898087
-0.063 0.109 0.1 8 -2536.46790779
-0.063 0.11 0.1 8 -2537.27651756
-0.064 0.09 0.1 8 -2538.86351408
-0.064 0.091 0.1 8 -2538.06321125
-0.064 0.092 0.1 8 -2537.35515792
-0.064 0.093 0.1 8 -2536.7383917
-0.064 0.094 0.1 8 -2536.21198792
-0.064 0.095 0.1 8 -2535.77505805
-0.064 0.096 0.1 8 -2535.42674817
-0.064 0.097 0.1 8 -2535.16623755
-0.064 0.098 0.1 8 -2534.99273733
-0.064 0.099 0.1 8 -2534.90548917
-0.064 0.1 0.1 8 -2534.9037641
-0.064 0.101 0.1 8 -2534.98686132
-0.064 0.102 0.1 8 -2535.15410709
-0.064 0.103 0.1 8 -2535.40485374
-0.064 0.104 0.1 8 -2535.73283704
-0.064 0.105 0.1 8 -2536.14016183
-0.064 0.106 0.1 8 -2536.62928234
-0.064 0.107 0.1 8 -2537.19964381
-0.064 0.108 0.1 8 -2537.85071298
-0.064 0.109 0.1 8 -2538.58197737
-0.064 0.11 0.1 8 -2539.39294451
+0.0001 0.0001 1e-05 11270 -220027.423471
+0.0001 0.000145977430289 1e-05 11270 -220027.423892
+0.0001 0.000213094101537 1e-05 11270 -220027.424507
+0.0001 0.00031106929352 1e-05 11270 -220027.425405
+0.0001 0.000454090961097 1e-05 11270 -220027.426718
+0.0001 0.000662870316183 1e-05 11270 -220027.42864
+0.0001 0.000967641053709 1e-05 11270 -220027.431456
+0.0001 0.00141253754462 1e-05 11270 -220027.43559
+0.0001 0.0020619860095 1e-05 11270 -220027.441671
+0.0001 0.00301003418958 1e-05 11270 -220027.450652
+0.0001 0.00439397056076 1e-05 11270 -220027.463985
+0.0001 0.00641420531224 1e-05 11270 -220027.483937
+0.0001 0.00936329208824 1e-05 11270 -220027.51414
+0.0001 0.0136682931808 1e-05 11270 -220027.560644
+0.0001 0.0199526231497 1e-05 11270 -220027.63404
+0.000163789370695 0.0001 1e-05 11270 -220027.424054
+0.000163789370695 0.000145977430289 1e-05 11270 -220027.424742
+0.000163789370695 0.000213094101537 1e-05 11270 -220027.425749
+0.000163789370695 0.00031106929352 1e-05 11270 -220027.427219
+0.000163789370695 0.000454090961097 1e-05 11270 -220027.42937
+0.000163789370695 0.000662870316183 1e-05 11270 -220027.432517
+0.000163789370695 0.000967641053709 1e-05 11270 -220027.437127
+0.000163789370695 0.00141253754462 1e-05 11270 -220027.443895
+0.000163789370695 0.0020619860095 1e-05 11270 -220027.453852
+0.000163789370695 0.00301003418958 1e-05 11270 -220027.468555
+0.000163789370695 0.00439397056076 1e-05 11270 -220027.490385
+0.000163789370695 0.00641420531224 1e-05 11270 -220027.523051
+0.000163789370695 0.00936329208824 1e-05 11270 -220027.572501
+0.000163789370695 0.0136682931808 1e-05 11270 -220027.648641
+0.000163789370695 0.0199526231497 1e-05 11270 -220027.76881
+0.000268269579528 0.0001 1e-05 11270 -220027.425007
+0.000268269579528 0.000145977430289 1e-05 11270 -220027.426134
+0.000268269579528 0.000213094101537 1e-05 11270 -220027.427781
+0.000268269579528 0.00031106929352 1e-05 11270 -220027.430188
+0.000268269579528 0.000454090961097 1e-05 11270 -220027.433708
+0.000268269579528 0.000662870316183 1e-05 11270 -220027.438859
+0.000268269579528 0.000967641053709 1e-05 11270 -220027.446406
+0.000268269579528 0.00141253754462 1e-05 11270 -220027.457483
+0.000268269579528 0.0020619860095 1e-05 11270 -220027.473781
+0.000268269579528 0.00301003418958 1e-05 11270 -220027.497849
+0.000268269579528 0.00439397056076 1e-05 11270 -220027.533581
+0.000268269579528 0.00641420531224 1e-05 11270 -220027.58705
+0.000268269579528 0.00936329208824 1e-05 11270 -220027.667993
+0.000268269579528 0.0136682931808 1e-05 11270 -220027.792624
+0.000268269579528 0.0199526231497 1e-05 11270 -220027.989325
+0.000439397056076 0.0001 1e-05 11270 -220027.426565
+0.000439397056076 0.000145977430289 1e-05 11270 -220027.428409
+0.000439397056076 0.000213094101537 1e-05 11270 -220027.431104
+0.000439397056076 0.00031106929352 1e-05 11270 -220027.435043
+0.000439397056076 0.000454090961097 1e-05 11270 -220027.440802
+0.000439397056076 0.000662870316183 1e-05 11270 -220027.44923
+0.000439397056076 0.000967641053709 1e-05 11270 -220027.461579
+0.000439397056076 0.00141253754462 1e-05 11270 -220027.479703
+0.000439397056076 0.0020619860095 1e-05 11270 -220027.506369
+0.000439397056076 0.00301003418958 1e-05 11270 -220027.545748
+0.000439397056076 0.00439397056076 1e-05 11270 -220027.604212
+0.000439397056076 0.00641420531224 1e-05 11270 -220027.691699
+0.000439397056076 0.00936329208824 1e-05 11270 -220027.824138
+0.000439397056076 0.0136682931808 1e-05 11270 -220028.028059
+0.000439397056076 0.0199526231497 1e-05 11270 -220028.349903
+0.000719685673001 0.0001 1e-05 11270 -220027.42911
+0.000719685673001 0.000145977430289 1e-05 11270 -220027.432126
+0.000719685673001 0.000213094101537 1e-05 11270 -220027.436532
+0.000719685673001 0.00031106929352 1e-05 11270 -220027.442972
+0.000719685673001 0.000454090961097 1e-05 11270 -220027.452389
+0.000719685673001 0.000662870316183 1e-05 11270 -220027.46617
+0.000719685673001 0.000967641053709 1e-05 11270 -220027.486361
+0.000719685673001 0.00141253754462 1e-05 11270 -220027.515996
+0.000719685673001 0.0020619860095 1e-05 11270 -220027.559598
+0.000719685673001 0.00301003418958 1e-05 11270 -220027.623986
+0.000719685673001 0.00439397056076 1e-05 11270 -220027.719582
+0.000719685673001 0.00641420531224 1e-05 11270 -220027.862631
+0.000719685673001 0.00936329208824 1e-05 11270 -220028.079185
+0.000719685673001 0.0136682931808 1e-05 11270 -220028.412622
+0.000719685673001 0.0199526231497 1e-05 11270 -220028.938883
+0.00117876863479 0.0001 1e-05 11270 -220027.43326
+0.00117876863479 0.000145977430289 1e-05 11270 -220027.438186
+0.00117876863479 0.000213094101537 1e-05 11270 -220027.445383
+0.00117876863479 0.00031106929352 1e-05 11270 -220027.455901
+0.00117876863479 0.000454090961097 1e-05 11270 -220027.471281
+0.00117876863479 0.000662870316183 1e-05 11270 -220027.49379
+0.00117876863479 0.000967641053709 1e-05 11270 -220027.526769
+0.00117876863479 0.00141253754462 1e-05 11270 -220027.575172
+0.00117876863479 0.0020619860095 1e-05 11270 -220027.646388
+0.00117876863479 0.00301003418958 1e-05 11270 -220027.751556
+0.00117876863479 0.00439397056076 1e-05 11270 -220027.907695
+0.00117876863479 0.00641420531224 1e-05 11270 -220028.141345
+0.00117876863479 0.00936329208824 1e-05 11270 -220028.495054
+0.00117876863479 0.0136682931808 1e-05 11270 -220029.039683
+0.00117876863479 0.0199526231497 1e-05 11270 -220029.899275
+0.00193069772888 0.0001 1e-05 11270 -220027.440007
+0.00193069772888 0.000145977430289 1e-05 11270 -220027.448039
+0.00193069772888 0.000213094101537 1e-05 11270 -220027.459772
+0.00193069772888 0.00031106929352 1e-05 11270 -220027.476921
+0.00193069772888 0.000454090961097 1e-05 11270 -220027.501997
+0.00193069772888 0.000662870316183 1e-05 11270 -220027.538696
+0.00193069772888 0.000967641053709 1e-05 11270 -220027.592466
+0.00193069772888 0.00141253754462 1e-05 11270 -220027.671383
+0.00193069772888 0.0020619860095 1e-05 11270 -220027.787497
+0.00193069772888 0.00301003418958 1e-05 11270 -220027.958967
+0.00193069772888 0.00439397056076 1e-05 11270 -220028.213545
+0.00193069772888 0.00641420531224 1e-05 11270 -220028.594504
+0.00193069772888 0.00936329208824 1e-05 11270 -220029.171224
+0.00193069772888 0.0136682931808 1e-05 11270 -220030.059251
+0.00193069772888 0.0199526231497 1e-05 11270 -220031.46086
+0.00316227766017 0.0001 1e-05 11270 -220027.450926
+0.00316227766017 0.000145977430289 1e-05 11270 -220027.463983
+0.00316227766017 0.000213094101537 1e-05 11270 -220027.483058
+0.00316227766017 0.00031106929352 1e-05 11270 -220027.510937
+0.00316227766017 0.000454090961097 1e-05 11270 -220027.551705
+0.00316227766017 0.000662870316183 1e-05 11270 -220027.611367
+0.00316227766017 0.000967641053709 1e-05 11270 -220027.698782
+0.00316227766017 0.00141253754462 1e-05 11270 -220027.82708
+0.00316227766017 0.0020619860095 1e-05 11270 -220028.015852
+0.00316227766017 0.00301003418958 1e-05 11270 -220028.29462
+0.00316227766017 0.00439397056076 1e-05 11270 -220028.708507
+0.00316227766017 0.00641420531224 1e-05 11270 -220029.32787
+0.00316227766017 0.00936329208824 1e-05 11270 -220030.26552
+0.00316227766017 0.0136682931808 1e-05 11270 -220031.709342
+0.00316227766017 0.0199526231497 1e-05 11270 -220033.988259
+0.00517947467923 0.0001 1e-05 11270 -220027.468461
+0.00517947467923 0.000145977430289 1e-05 11270 -220027.489589
+0.00517947467923 0.000213094101537 1e-05 11270 -220027.520455
+0.00517947467923 0.00031106929352 1e-05 11270 -220027.565567
+0.00517947467923 0.000454090961097 1e-05 11270 -220027.631535
+0.00517947467923 0.000662870316183 1e-05 11270 -220027.728076
+0.00517947467923 0.000967641053709 1e-05 11270 -220027.869527
+0.00517947467923 0.00141253754462 1e-05 11270 -220028.077134
+0.00517947467923 0.0020619860095 1e-05 11270 -220028.382599
+0.00517947467923 0.00301003418958 1e-05 11270 -220028.8337
+0.00517947467923 0.00439397056076 1e-05 11270 -220029.50346
+0.00517947467923 0.00641420531224 1e-05 11270 -220030.50575
+0.00517947467923 0.00936329208824 1e-05 11270 -220032.023162
+0.00517947467923 0.0136682931808 1e-05 11270 -220034.359815
+0.00517947467923 0.0199526231497 1e-05 11270 -220038.048153
+0.00848342898244 0.0001 1e-05 11270 -220027.496279
+0.00848342898244 0.000145977430289 1e-05 11270 -220027.53021
+0.00848342898244 0.000213094101537 1e-05 11270 -220027.579781
+0.00848342898244 0.00031106929352 1e-05 11270 -220027.652231
+0.00848342898244 0.000454090961097 1e-05 11270 -220027.758175
+0.00848342898244 0.000662870316183 1e-05 11270 -220027.913222
+0.00848342898244 0.000967641053709 1e-05 11270 -220028.140396
+0.00848342898244 0.00141253754462 1e-05 11270 -220028.473821
+0.00848342898244 0.0020619860095 1e-05 11270 -220028.964417
+0.00848342898244 0.00301003418958 1e-05 11270 -220029.688926
+0.00848342898244 0.00439397056076 1e-05 11270 -220030.764653
+0.00848342898244 0.00641420531224 1e-05 11270 -220032.374528
+0.00848342898244 0.00936329208824 1e-05 11270 -220034.81191
+0.00848342898244 0.0136682931808 1e-05 11270 -220038.565459
+0.00848342898244 0.0199526231497 1e-05 11270 -220044.490781
+0.0138949549437 0.0001 1e-05 11270 -220027.539544
+0.0138949549437 0.000145977430289 1e-05 11270 -220027.593389
+0.0138949549437 0.000213094101537 1e-05 11270 -220027.672054
+0.0138949549437 0.00031106929352 1e-05 11270 -220027.787023
+0.0138949549437 0.000454090961097 1e-05 11270 -220027.955146
+0.0138949549437 0.000662870316183 1e-05 11270 -220028.201192
+0.0138949549437 0.000967641053709 1e-05 11270 -220028.561701
+0.0138949549437 0.00141253754462 1e-05 11270 -220029.090829
+0.0138949549437 0.0020619860095 1e-05 11270 -220029.869396
+0.0138949549437 0.00301003418958 1e-05 11270 -220031.019211
+0.0138949549437 0.00439397056076 1e-05 11270 -220032.726484
+0.0138949549437 0.00641420531224 1e-05 11270 -220035.28164
+0.0138949549437 0.00936329208824 1e-05 11270 -220039.150477
+0.0138949549437 0.0136682931808 1e-05 11270 -220045.109014
+0.0138949549437 0.0199526231497 1e-05 11270 -220054.516158
+0.0227584592607 0.0001 1e-05 11270 -220027.604764
+0.0227584592607 0.000145977430289 1e-05 11270 -220027.688627
+0.0227584592607 0.000213094101537 1e-05 11270 -220027.811148
+0.0227584592607 0.00031106929352 1e-05 11270 -220027.990215
+0.0227584592607 0.000454090961097 1e-05 11270 -220028.252069
+0.0227584592607 0.000662870316183 1e-05 11270 -220028.635295
+0.0227584592607 0.000967641053709 1e-05 11270 -220029.196809
+0.0227584592607 0.00141253754462 1e-05 11270 -220030.020972
+0.0227584592607 0.0020619860095 1e-05 11270 -220031.233691
+0.0227584592607 0.00301003418958 1e-05 11270 -220033.024747
+0.0227584592607 0.00439397056076 1e-05 11270 -220035.684297
+0.0227584592607 0.00641420531224 1e-05 11270 -220039.664958
+0.0227584592607 0.00936329208824 1e-05 11270 -220045.692799
+0.0227584592607 0.0136682931808 1e-05 11270 -220054.977676
+0.0227584592607 0.0199526231497 1e-05 11270 -220069.638543
+0.0372759372031 0.0001 1e-05 11270 -220027.698422
+0.0372759372031 0.000145977430289 1e-05 11270 -220027.825392
+0.0372759372031 0.000213094101537 1e-05 11270 -220028.010892
+0.0372759372031 0.00031106929352 1e-05 11270 -220028.282006
+0.0372759372031 0.000454090961097 1e-05 11270 -220028.678468
+0.0372759372031 0.000662870316183 1e-05 11270 -220029.258698
+0.0372759372031 0.000967641053709 1e-05 11270 -220030.108881
+0.0372759372031 0.00141253754462 1e-05 11270 -220031.35677
+0.0372759372031 0.0020619860095 1e-05 11270 -220033.193044
+0.0372759372031 0.00301003418958 1e-05 11270 -220035.905157
+0.0372759372031 0.00439397056076 1e-05 11270 -220039.932658
+0.0372759372031 0.00641420531224 1e-05 11270 -220045.961343
+0.0372759372031 0.00936329208824 1e-05 11270 -220055.091575
+0.0372759372031 0.0136682931808 1e-05 11270 -220069.157308
+0.0372759372031 0.0199526231497 1e-05 11270 -220091.371085
+0.0610540229659 0.0001 1e-05 11270 -220027.823505
+0.0610540229659 0.000145977430289 1e-05 11270 -220028.008048
+0.0610540229659 0.000213094101537 1e-05 11270 -220028.277661
+0.0610540229659 0.00031106929352 1e-05 11270 -220028.671711
+0.0610540229659 0.000454090961097 1e-05 11270 -220029.247951
+0.0610540229659 0.000662870316183 1e-05 11270 -220030.091301
+0.0610540229659 0.000967641053709 1e-05 11270 -220031.327042
+0.0610540229659 0.00141253754462 1e-05 11270 -220033.140891
+0.0610540229659 0.0020619860095 1e-05 11270 -220035.810071
+0.0610540229659 0.00301003418958 1e-05 11270 -220039.752546
+0.0610540229659 0.00439397056076 1e-05 11270 -220045.607535
+0.0610540229659 0.00641420531224 1e-05 11270 -220054.372543
+0.0610540229659 0.00936329208824 1e-05 11270 -220067.648403
+0.0610540229659 0.0136682931808 1e-05 11270 -220088.103672
+0.0610540229659 0.0199526231497 1e-05 11270 -220120.413364
+0.1 0.0001 1e-05 11270 -220027.97435
+0.1 0.000145977430289 1e-05 11270 -220028.228322
+0.1 0.000213094101537 1e-05 11270 -220028.599372
+0.1 0.00031106929352 1e-05 11270 -220029.141677
+0.1 0.000454090961097 1e-05 11270 -220029.934723
+0.1 0.000662870316183 1e-05 11270 -220031.095385
+0.1 0.000967641053709 1e-05 11270 -220032.796098
+0.1 0.00141253754462 1e-05 11270 -220035.292484
+0.1 0.0020619860095 1e-05 11270 -220038.966138
+0.1 0.00301003418958 1e-05 11270 -220044.392434
+0.1 0.00439397056076 1e-05 11270 -220052.451402
+0.1 0.00641420531224 1e-05 11270 -220064.51647
+0.1 0.00936329208824 1e-05 11270 -220082.791961
+0.1 0.0136682931808 1e-05 11270 -220110.952545
+0.1 0.0199526231497 1e-05 11270 -220155.435246
diff --git a/experiments/process.py b/experiments/process.py
index 5f3cff4..f31e0d4 100644
--- a/experiments/process.py
+++ b/experiments/process.py
@@ -15,20 +15,20 @@ if __name__ == "__main__":
sys.exit("usage: {0} <file>".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(-3,0,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(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(.03, .065, .001) # parameter of the time component
+ # alphas = np.arange(.04, .075, .003) # parameter of the time component
# # alphas = np.logspace(-4,-1,num=20)
- # deltas = np.arange(.09, .11, .001) # parameter of the structural component
+ # deltas = np.arange(.07, .11, .003) # parameter of the structural component
# # deltas = np.logspace(-2,-.5,num=20)
# lmbda = 0.10#np.logspace(-12,-3,num=10)
# with open("out.log", "w") as fh:
@@ -38,7 +38,7 @@ if __name__ == "__main__":
# fh.write("\t".join(map(str, [alpha, delta, lmbda, roots, ll])) + "\n")
# fh.flush()
- alpha = 0.041
- delta = 0.01
- beta, roots, ll = ml2(root_victims, victims, non_victims, alpha, delta, 1.)
- print "\t".join(map(str, [alpha, delta, beta, roots, ll])) \ No newline at end of file
+ # alpha = 0.061
+ # delta = 0.082
+ # beta, roots, ll = ml2(root_victims, victims, non_victims, alpha, delta, 1.)
+ # print "\t".join(map(str, [alpha, delta, beta, roots, ll])) \ No newline at end of file