createRandomPlan {BARD} | R Documentation |
These methods create plans starting with random seeds. These plans should be refined with one of the refinement functions.
createRandomPlan(basemap,ndists) createRandomPopPlan(basemap,ndists,predvar="POP") createAssignedPlan(basemap,predvar="BARDPlanID") createKmeansPlan(basemap,ndists) createContiguousPlan(basemap, ndists, predvar = "POP", threshold = 0.05, ssize = 20, usebb = TRUE, maxtries = (10/threshold), neighborstarts = TRUE, fillholes = TRUE)
basemap |
Bard basemap from which to create plan |
ndists |
number of districts to create |
predvar |
name of variable containing variabe of interst (for createAssignedPlan can be a vector or block assignments) |
threshold |
tolerance threshold for districts being "equal" in population |
ssize |
check up to ssize neighbors at random, shoosing the one with the fewest foreign neighbors |
usebb |
use bounding box compactness |
maxtries |
maximum number of tries to create plan |
neighborstarts |
whether to start new district at neighbors of existing districts |
fillholes |
fill any holes remaining |
createKmeansPlan
create plans through applying kmeans to the center of each polygon. It tends toward contiguity, but is not guaranteed to produce contiguous plans
createRandomPlan
creates plans by random block assignment, as per Grofman [1982], these are highly non-contiguous
createRandomPopPlan
creates plans by random block assignment, but caps each district at a population threshold. It will not add a block to a district in formation that will cause the plan to
go more than (1+threshold)/(totalpopulation/plan), unless that block would cause all
districts to exceed their thresholds. With blocks of single individuals, and a threshold of 0 this is equivalent to the random assignment discusses. in Bush v. Vera [2004]
createContiguousPlan
duplicates the algorthim in Cirincione, et. al (see the references). As per
pg 196:
``The first algorithm, the contiguity algorithm, begins by randomly selecting a block group to serve as the base of the first district. It then constructs a perimeter list containing the unassigned block groups contiguous to the base block group. The program then randomly selects a block group from the perimeter list to add to the emerging district and adjusts the perimeter list. This process continues until the population of the emerging district achieves the desired district population level. (A newly created district is thrown out if its population deviates by more than 1 from the ideal district average population, which in this case is 581,117.) The next district begins with the random selection of a census block group from among those that touch one of the completed districts.''
(Note that ssize was not included as an option, originally)
Returns a bard plan. Note that this plan is not guaranteed to be contiguous, or equipopulous.
Micah Altman Micah_Altman@harvard.edu http://www.hmdc.harvard.edu/micah_altman/
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.
Bush v. Vera, 517 U.S. 952 (1996).
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
C. Cirincione , T.A. Darling, and T.G. O'Rourke. 2000. ``Assessing South Carolina's 1990's Congressional Districting.'' Political Geography 19: 189-211.
Grofman, B. 1982, "For single Member Districts Random is Not Equal", In Representation and Redistricting Issues, ed. B. Grofman, A. Lijphart, R. McKay, H. Scarrow. Lexington, MA: Lexington Books.
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.
Interactive editing editPlanInteractive
Plan refinement algorithms refineGreedyPlan
, refineAnnealPlan
, refineGenoudPlan
, refineNelderPlan
# read in a shapefile with demographic data suffolk.map <- importBardShape( file.path(system.file("shapefiles", package="BARD"),"suffolk_tracts") ) # choose number of districts ndists <- 5 # create some initial plans kplan <- createKmeansPlan(suffolk.map,ndists) rplan <- createRandomPlan(suffolk.map,ndists) aplan <- createAssignedPlan(suffolk.map,predvar=1:ndists) ## Not run: cplan <- createContiguousPlan(suffolk.map,ndists) ## End(Not run) plot(kplan) summary(kplan) plot(summary(rplan))