BARD-package {BARD}R Documentation

A package for better automated redistricting.

Description

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.

Details

Package: BARD
Type: Package
Version: 1.01
Date: 2009-1-2
License: AGPL 3.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. (createRandomPlan, createRandomPopPlan, createContiguousPlan, createKmeansPlan, createWeightedKmeansPlan,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, calcMomentScore)

5. Plan refinement. Multi-criteria optimization heuristics for refining plans to meet specified goals. (refineGreedyPlan, refineAnnealPlan, refineGenoudPlan, refineNelderPlan, refineGRASPPlan,startBardCluster ,refineTabuPlan)

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)

Author(s)

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/

References

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.

See Also

spdep , maptools , rgenoud

Examples

  
    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)

   ## Not run: 
   if (require("iplots",quietly=TRUE)) {
        rplan<-editPlanInteractive(rplan,calcPopScore,predvar="POP")
   }
   
## End(Not run)

  myScore<-function(plan,...)  {
    return(calcContiguityScore(plan,...))
  }      

#just for quick demonstration -- nelder method not effective

improvedRplan<-refineNelderPlan(plan=rplan2, score.fun=myScore, displaycount=100, historysize=0, dynamicscoring=FALSE, tracelevel=1, maxit=100)

## Not run: 
 # This works better, but will take a while
 improvedRplan<-refineAnnealPlan(plan=rplan2, score.fun=myScore, historysize=0, dynamicscoring=FALSE, tracelevel=1)
## End(Not run)

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))


[Package BARD version 1.03 Index]