From f2891c93b96388442d44512e6c43b092153f8c25 Mon Sep 17 00:00:00 2001 From: Ben Green Date: Sat, 20 Jun 2015 10:13:23 -0400 Subject: tried generating cascades and recovering parameters, still got the same result where optimization minimizes alpha, delta as much as possible --- R Scripts/generate-dag-dat.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'R Scripts/generate-dag-dat.R') 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') -- cgit v1.2.3-70-g09d2