diff options
| author | Ben Green <ben@SEASITs-MacBook-Pro.local> | 2015-06-28 17:38:33 -0400 |
|---|---|---|
| committer | Ben Green <ben@SEASITs-MacBook-Pro.local> | 2015-06-28 17:38:33 -0400 |
| commit | 6e527bbf612465bf5d739b9652abc0165550993c (patch) | |
| tree | 9525bed16d9e4568747855afd84a03937090f1cb /R Scripts/find-cascades.R | |
| parent | 7167a81cfb8b872dd1547e5a8669004b191417db (diff) | |
| download | criminal_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.
Diffstat (limited to 'R Scripts/find-cascades.R')
| -rw-r--r-- | R Scripts/find-cascades.R | 11 |
1 files changed, 6 insertions, 5 deletions
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) |
