BARD-package {BARD} | R Documentation |
BARD will automatically generate redistricting plans using multi-criteria optimization algorithms. BARD can analyze and compare plans for differences in assignment and criteria. BARD supports heuristic exploration of plans, in order to show trade-offs among redistricting criteria.
Package: | BARD |
Type: | Package |
Version: | 1.0 |
Date: | 2007-1-15 |
License: | GPL 2.0 |
Bard supports several areas of functionality: 1. Plan input output. Reading and writing plans in various formats. ( readBardImage, writeBardImage, readBardCheckpoint, writeBardCheckpoint,importBardShape, exportBardShape )
2. Initial plan generation. Quick heuristics for generating random plans, or plans based on a fixed set of criteria. (link{createRandomPlan}, createRandomPopPlan, createContiguousPlan, createKmeansPlan, fillHolesPlan)
3. Interactive plan editing. Adjust plans interactively, using a mouse. (editPlanInteractive)
4. Plan scoring. Scoring functions for use in plan refinement, profiling, and comparison. (calcContiguityScore, calcReockScore, calcLWCompactScore, calcGroupScore, calcPopScore, calcHolesScore, calcRangeScore)
5. Plan refinement. Multi-criteria optimization heuristics for refining plans to meet specified goals. (refineGreedyPlan, refineAnnealPlan, refineGenoudPlan, refineNelderPlan, refineGRASPPlan,startBardCluster )
6. Plan profiling and exploration. Generate profiles of plans to explore tradeoffs among redistricting criteria. This can be used in conjunction with snow to distribute plan generation across a computing cluster
(samplePlans, profilePlans, startBardCluster )
8. Plan comparison and analysis. Plot, score, and compare plans. (reportPlans, scorePlans, diff.bardPlan)
Micah Altman Micah_Altman@harvard.edu http://www.hmdc.harvard.edu/micah_altman/
Maintainer: Micah Altman Micah_Altman@harvard.edu http://www.hmdc.harvard.edu/micah_altman/
Altman & McDonald, 2004. A computation intensive method for Evaluating Intent in Redistricting. Presented at the Midwest Political Science Associaton Meeting, Micah Altman, 1997. ``Is Automation the Answer? The Computational Complexity of Automated Redistricting'', Rutgers Computer and Technology Law Journal 23 (1), 81-142 http://www.hmdc.harvard.edu/micah_altman/pubpapers.shtml
Altman, M. 1998. Modeling the Effect of Mandatory District Compactness on Partisan Gerrymanders, Political Geography 17:989-1012.
C. Cirincione , T.A. Darling, and T.G. O'Rourke. 2000. ``Assessing South Carolina's 1990's Congressional Districting.'' Political Geography 19: 189-211.
Micah Altman and Michael P. McDonald. 2004. A Computation Intensive Method for Detecting Gerrymanders Paper presented at the annual meeting of the The Midwest Political Science Association, Palmer House Hilton, Chicago, Illinois, Apr 15, 2004. http://www.allacademic.com/meta/p83108_index.html
Micah Altman, Karin Mac Donald, and Michael P. McDonald, 2005. ``From Crayons to Computers: The Evolution of Computer Use in Redistricting'' Social Science Computer Review 23(3): 334-46.
suffolk.map <- importBardShape( file.path(system.file("shapefiles", package="BARD"),"suffolk_tracts") ) numberdists <- 5 kplan <- createKmeansPlan(suffolk.map,numberdists) rplan <- createRandomPlan(suffolk.map,numberdists) rplan2 <- createRandomPopPlan(suffolk.map,numberdists) plot(kplan) reportPlans(plans=list("kmeans"=kplan,"random 1"=rplan,"random pop"=rplan2), doplot=TRUE) ow<-options(warn=-1) if (require("iplots",quietly=TRUE)) { rplan<-editPlanInteractive(rplan,calcPopScore,predvar="POP") } options(ow) myScore<-function(plan,...) { return(calcContiguityScore(plan,...)) } #just for quik demonstration -- nelder method not effective improvedRplan<-refineNelderPlan(plan=rplan2, score.fun=myScore, displaycount=100, historysize=0, dynamicscoring=FALSE, tracelevel=1, maxit=100) samples<-samplePlans(kplan, score.fun=myScore, ngenplans=10, gen.fun = "createRandomPlan", refine.fun="refineNelderPlan",refine.args=list(maxit=200,dynamicscoring=TRUE)) profplans<-profilePlans( list(kplan,rplan), score.fun=calcContiguityScore, addscore.fun=calcPopScore, numevals=2, weight=c(0,.5,1), refine.fun="refineNelderPlan",refine.args=list(maxit=200,dynamicscoring=TRUE) ) summary(samples) plot(summary(samples)) reportPlans(samples) plot(summary(profplans))