diff options
| author | Ben Green <ben@SEASITs-MacBook-Pro.local> | 2015-07-01 00:49:23 -0400 |
|---|---|---|
| committer | Ben Green <ben@SEASITs-MacBook-Pro.local> | 2015-07-01 00:49:23 -0400 |
| commit | 8e09ca6ca68c71bdab65525b529e2adfa281823c (patch) | |
| tree | d395bfcb0f9f0bc1092072ae1a8a9d3ad9c98a4a /R Scripts/predict-victims-plots.R | |
| parent | 6e527bbf612465bf5d739b9652abc0165550993c (diff) | |
| download | criminal_cascades-8e09ca6ca68c71bdab65525b529e2adfa281823c.tar.gz | |
Got predict-victims running in parallel, drastically reducing the time
for each test. Also changed how we get the rankings of infected
individuals each day.
Diffstat (limited to 'R Scripts/predict-victims-plots.R')
| -rw-r--r-- | R Scripts/predict-victims-plots.R | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/R Scripts/predict-victims-plots.R b/R Scripts/predict-victims-plots.R index 8a93667..2ac62c8 100644 --- a/R Scripts/predict-victims-plots.R +++ b/R Scripts/predict-victims-plots.R @@ -2,7 +2,7 @@ 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) +hist(correct_rank2,150,xlim=c(0,vcount(lcc)),col=rgb(0,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))) @@ -12,9 +12,9 @@ counts = matrix(c(colSums(correct_rank<(vcount(lcc)/1000))*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))] +correct_rank1 = correct_rank[,length(lambdas)] # demographics model +correct_rank2 = correct_rank[,1] # cascade model +correct_rank3 = correct_rank[,which.min(colMeans(correct_rank))] # best combined model counts = matrix(c(sum(correct_rank1<(vcount(lcc)*0.001)), sum(correct_rank1<(vcount(lcc)*0.005)), sum(correct_rank1<(vcount(lcc)*0.01)), @@ -59,3 +59,4 @@ 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)) + |
