diff options
| author | Ben Green <ben@SEASITs-MacBook-Pro.local> | 2015-06-20 10:13:23 -0400 |
|---|---|---|
| committer | Ben Green <ben@SEASITs-MacBook-Pro.local> | 2015-06-20 10:13:23 -0400 |
| commit | f2891c93b96388442d44512e6c43b092153f8c25 (patch) | |
| tree | f85236ec90e1524a63731aec2ddbe017ab233fe5 /R Scripts/generate-dag-dat.R | |
| parent | 958c31ca10c4eed08da818b9e16d84ebfeb44c27 (diff) | |
| download | criminal_cascades-f2891c93b96388442d44512e6c43b092153f8c25.tar.gz | |
tried generating cascades and recovering parameters, still got the same
result where optimization minimizes alpha, delta as much as possible
Diffstat (limited to 'R Scripts/generate-dag-dat.R')
| -rwxr-xr-x | R Scripts/generate-dag-dat.R | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/R Scripts/generate-dag-dat.R b/R Scripts/generate-dag-dat.R index b5f2c3a..a2df165 100755 --- a/R Scripts/generate-dag-dat.R +++ b/R Scripts/generate-dag-dat.R @@ -6,7 +6,7 @@ vic_ids = which(V(hyp_lcc)$vic==TRUE) edgeWeights = function(eis){return(c(hyp_lcc_edges$weight[eis],Inf,Inf)[1:3])} -dag_dat_all = data.frame(matrix(nrow=1,ncol=8)) +dag_dat_all = data.frame(matrix(nrow=1,ncol=10)) hyp_lcc2 = remove.edge.attribute(hyp_lcc,'weight') ei = 1 ptm=proc.time() @@ -28,15 +28,15 @@ for (u in vic_ids){ #will be faster to pre-allocate and fill in rather than rbind each time dag_dat_all[ei:(ei+length(nbhd)-1),] = data.frame(rep(u,length(nbhd)), nbhd, rep(tu,length(nbhd)), tvs, dists, - weights, row.names=NULL) + weights, u_spawn, v_spawn, row.names=NULL) ei = ei + length(nbhd) } print(proc.time()-ptm) #3.5 hours -colnames(dag_dat_all) = c('from','to','t1','t2','dist','w1','w2','w3') +colnames(dag_dat_all) = c('from','to','t1','t2','dist','w1','w2','w3','spawn1','spawn2') rownames(dag_dat_all) = NULL -dag_dat_all$spawn1 = hyp_lcc_verts$spawn.date[dag_dat_all$from] -dag_dat_all$spawn2 = hyp_lcc_verts$spawn.date[dag_dat_all$to] +# dag_dat_all$spawn1 = hyp_lcc_verts$spawn.date[dag_dat_all$from] +# dag_dat_all$spawn2 = hyp_lcc_verts$spawn.date[dag_dat_all$to] save(dag_dat_all, file='Results/dag_dat_all.RData') write.csv(dag_dat_all, file='Results/dag_dat_all.csv') |
