diff --git a/DESCRIPTION b/DESCRIPTION index 24c741cc..4e2d1d04 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: redist -Version: 4.2.0.9999 -Date: 2023-04-24 +Version: 4.2.0 +Date: 2024-01-11 Title: Simulation Methods for Legislative Redistricting Authors@R: c( person("Christopher T.", "Kenny", email = "christopherkenny@fas.harvard.edu", role = c("aut", "cre")), diff --git a/R/redist_ms.R b/R/redist_ms.R index d7b841db..26247f4b 100644 --- a/R/redist_ms.R +++ b/R/redist_ms.R @@ -77,7 +77,7 @@ #' #' McCartan, C., & Imai, K. (2023). Sequential Monte Carlo for Sampling #' Balanced and Compact Redistricting Plans. *Annals of Applied Statistics* 17(4). -#' Available at \url{http://dx.doi.org/10.1214/23-AOAS1763}. +#' Available at \doi{10.1214/23-AOAS1763}. #' #' DeFord, D., Duchin, M., and Solomon, J. (2019). Recombination: A family of #' Markov chains for redistricting. arXiv preprint arXiv:1911.05725. diff --git a/R/redist_smc.R b/R/redist_smc.R index 9336e985..6d2a20e2 100644 --- a/R/redist_smc.R +++ b/R/redist_smc.R @@ -111,7 +111,7 @@ #' @references #' McCartan, C., & Imai, K. (2023). Sequential Monte Carlo for Sampling #' Balanced and Compact Redistricting Plans. *Annals of Applied Statistics* 17(4). -#' Available at \url{http://dx.doi.org/10.1214/23-AOAS1763}. +#' Available at \doi{10.1214/23-AOAS1763}. #' #' @examples \donttest{ #' data(fl25) diff --git a/cran-comments.md b/cran-comments.md index debbc377..e74c3803 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,19 +1,22 @@ ## Test environments -* local R installation (macOS), R 4.2.3 -* local R installation (Windows), R 4.2.2 -* ubuntu 20.04 (on GitHub Actions), (devel) -* ubuntu 20.04 (on GitHub Actions), (release) -* ubuntu 20.04 (on GitHub Actions), (old release) +* local R installation (macOS), R 4.3.2 +* local R installation (Windows), R 4.3.2 +* ubuntu 22.04 (on GitHub Actions), (release) +* ubuntu 22.04 (on GitHub Actions), (old release) * macOS-latest (on GitHub Actions), (release) * Windows (on GitHub Actions), (release) +* Windows (on Winbuilder), (devel and release) + ## R CMD check results 0 errors | 0 warnings | 0 notes ## Reverse Dependencies + There are no reverse dependencies to check. ## Additional Notes -* Fixes undefinited behavior found in CRAN checks. +* Fixes itemize braces Rd note for `redist.calc.frontier.size.Rd`, `redist.crsg.Rd`, and `redist.rsg.Rd`. +* Fixes "memory not mapped" error in `persily` function, which was due to be removed from the package in this release. diff --git a/docs/404.html b/docs/404.html index dce7cc96..cf3ea5f4 100644 --- a/docs/404.html +++ b/docs/404.html @@ -39,7 +39,7 @@ redist - 4.1.0 + 4.2.0 @@ -62,13 +62,10 @@ Common Arguments to `redist` Functions
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • @@ -134,7 +131,7 @@

    Page not found (404)

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 6972345b..94a47e15 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -17,7 +17,7 @@ redist - 4.1.0 + 4.2.0 @@ -38,13 +38,10 @@ Common Arguments to `redist` Functions
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • @@ -239,10 +236,10 @@

    plan #> redist.rsg(): Automated Redistricting Starts #> #> -#> 4 districts built using 99 precincts in 0.19 seconds... +#> 4 districts built using 99 precincts in 0.05 seconds... head(sim$plan) -#> [1] 4 3 2 3 4 2 +#> [1] 1 1 2 1 1 2

    plans @@ -379,7 +376,7 @@

    ncores

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/flip.html b/docs/articles/flip.html new file mode 100644 index 00000000..2fa8de42 --- /dev/null +++ b/docs/articles/flip.html @@ -0,0 +1,815 @@ + + + + + + + +Redistricting with Flip MCMC • redist + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +library(redist)
    +library(ggplot2)
    +library(dplyr)
    +library(patchwork)
    +# set seed for reproducibility
    +set.seed(1)
    +

    The redist package is designed to allow for replicable +redistricting simulations. This vignette covers the Flip Markov Chain +Monte Carlo method discussed in: Automated +Redistricting Simulation Using Markov Chain Monte Carlo.

    + +
    +

    The Flip MCMC Algorithm +

    +
    data(fl25)
    +data(fl25_enum)
    +plan <- fl25_enum$plans[, 7241]
    +fl25$plan <- plan
    +fl_map <- redist_map(fl25, existing_plan = plan, pop_tol = 0.2, total_pop = pop)
    +#> Projecting to CRS 3857
    +constr <- redist_constr(fl_map) %>% 
    +    add_constr_edges_rem(0.02)
    +set.seed(1)
    +sims <- redist_flip(map = fl_map, nsims = 6, constraints = constr)
    +#> 
    +#> 
[36m──
[39m 
[1m
[31mredist_flip()
[39m
[22m 
[36m───────────────────────────────────────────────────────────────
[39m
    +#> 
    +#> ── 
[1m
[1m
[31mAutomated Redistricting Simulation Using Markov Chain Monte Carlo
[39m
[1m
[22m ──
    +#> 
[36mℹ
[39m Preprocessing data.
    +#> 
[36mℹ
[39m Starting swMH().
    +#> 
    +
[32m■■■■■■                          
[39m  17% | ETA:  0s | MH Acceptance: 1.00
    +
    +
[32m■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 
[39m 100% | ETA:  0s | MH Acceptance: 1.00
    +

    The flip algorithm is one of the more straightforward +redistricting algorithms. Beginning with an initial partition of a +graph, it proposes flipping a node from one partition to an adjacent +partition. By checking that the proposed flip meets basic constraints, +such as keeping partitions contiguous and staying within a certain +population parity, it ensures that all proposed new partitions are also +valid partitions. The implementation within redist is a bit +more advanced that this, as it allows for multiple flips and rejecting +valid partitions based on a Metropolis Hastings algorithm. The following +walks through the basics of this algorithm to provide an introduction to +using flip correctly and efficiently.

    +

    +

    Suppose we are redistricting this small map above on the left. To use +the flip algorithm, we need to consider the adjacency graph +that underlies this map, which is above on the right. Each of the 25 +precincts on the left are displayed as a node on the right, connected if +they are contiguous on the map. If we use the above district as an +initial plan, we can then run flip for a few steps.

    +

    +

    While this map is extremely small, the five iterations give a basic +idea of what is going on behind the scenes. At each iteration, it +searches the boundary for possible swaps, selects one, and then accepts +or rejects the proposals. With very weak constraints, like those used to +create the above example, almost every swap is accepted. Even then, +though, it doesn’t guarantee that some iterations won’t repeat other +plans sampled. In fact, in the above, the second iteration is the same +plan as the initialization.

    +

    This possibility is very important for ensuring that the sampled +plans are representative of the desired target distribution, which is +controlled by the constraints chosen. The possible constraints are +discussed below, as is information on setting up simulations and some +advice on ensuring that your simulations are efficient.

    +

    Back to top

    +
    +
    +

    Strengths of Flip +

    +

    Flip is incredibly powerful for local exploration. If you can make +large changes to a summary statistic of interest without making large +changes to the map itself, this may tell an important story of what went +into making the map.

    +

    Flip is one of the easiest to understand algorithms and has +theoretical guarantees behind it. This can make it especially useful +when the audience of interest does not have an advanced background in +mathematics or statistics.

    +

    Flip has the power to make less compact maps than many other +algorithms. This can be especially powerful when a blind allegiance to +compactness makes otherwise viable plans appear to be outliers.

    +

    Our implementation of flip has many more Gibbs +constraints than our other implementations. This can allow you to +consider different forms of partisan and +countysplit constraints among others.

    +

    However, with these strengths do come weaknesses. Like most Markov +Chain Monte Carlo methods, convergence can’t be shown, it can only be +suggested. Diagnostics, like those in the section on +diagnostic plots, can help ensure that convergence is likely, but +can never show that it has indeed happened. Additionally, +flip makes relatively small moves per iteration, so many +more iterations are needed to move around the space. If your map is +particularly large, you may require several hundred iterations to make +the map substantively different, which leads to thinning +the chain, which is dropping many sequential iterations. However, +thinning doesn’t make the algorithm more efficient, so you +still need to work through those plans, which comes with a time +cost.

    +
    +
    +

    Initializing Flip +

    +

    One of the keys to ensuring good performance is the choice of +initialization. In some cases, a starting point may be obvious, such as +when you want to explore the local area around an existing map. If +that’s the use case, then it is straightforward to use that plan as the +starting point. However, if the goal is to understand the larger space +of possibilities, then starting from just one map can be misleading. +Why? Since constraint tuning is not a perfect science, you could be +setting the constraints too strong and, if that map is very good on some +dimension, the flip algorithm may have difficulty getting +away from that point without a very large number of iterations.

    +

    Our implementation defaults to using the Sequential Monte Carlo (SMC) +algorithm via redist_smc() to create an initial partition +of the districts, if no district is provided.

    +

    While the implementations of Random Seed and Grow (RSG) +and Compact Random Seed and Grow (CRSG) via +redist.rsg() and redist.crsg do not sample +from a defined target distribution, they can serve as useful +initializations for flip as they help provide a more +diverse set of starting states. SMC is often faster and +provides more theoretical guarantees, but tends to sample very compact +districts, even when decreasing the compactness constraint. As such, +when trying to decide if chains have likely converged or not, it can be +misleading to only check chains that start from very compact states.

    +
    +
    +

    Redistricting with Flip MCMC +

    +

    With the basics of what the flip algorithm is doing +down, we can proceed into how to use the algorithm.

    +

    To begin running the MCMC algorithm, we have to provide some basic +information, typically beginning with a shapefile. The below loads an +Iowa dataset included within the redist package and plots +the actual congressional districts from 2012-2021. (Iowa is a favorite +choice for redistricting simulation examples, as it requires keeping +counties together in plans which allows us to use the counties as the +unit for redistricting, rather than thousands of precincts.)

    +
    +data(iowa)
    +redist.plot.map(iowa, plan = cd_2010)
    +

    +
    +map_ia <- redist_map(iowa, existing_plan = cd_2010, pop_tol = 0.05)
    +

    From there, we need to build an adjacency graph which identifies +which counties are touching which other counties on a map. If you have +an existing plan, it’s generally advised to supply this to the optional +plan argument to ensure that the existing plan is a valid, +connected plan. If you get a warning, the geomander R package +can help solve potential issues.

    +

    In addition, we need population for each unit. We’ve included +iowa$pop as the total population as of the 2010 Census. +From there, we have the basic information that we need to run our first +simulation. The below indicates that we are simulating 1000 plans (with +nsims) for the state of Iowa that have at most a population +parity deviation of 0.05 (with pop_tol).

    +
    sims <- redist_flip(map_ia, nsims = 100)
    +#> 
    +#> 
[36m──
[39m 
[1m
[31mredist_flip()
[39m
[22m 
[36m───────────────────────────────────────────────────────────────
[39m
    +#> 
    +#> ── 
[1m
[1m
[31mAutomated Redistricting Simulation Using Markov Chain Monte Carlo
[39m
[1m
[22m ──
    +#> 
[36mℹ
[39m Preprocessing data.
    +#> 
[36mℹ
[39m Starting swMH().
    +#> 
    +
[32m■                               
[39m   1% | ETA: 0s
    +
    +
[32m■■■■■■■■■■■■■■■■■■■■■■■■■■      
[39m  84% | ETA:  0s | MH Acceptance: 0.62
    +
    +
[32m■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 
[39m 100% | ETA:  0s | MH Acceptance: 0.65
    +

    The printed output can be silenced by setting +verbose = FALSE, however it displays very important +information. First, it displays when preprocessing begins and when the +algorithm actually starts. Each 10% of the way through the +flip algorithm, it outputs the current estimated Metropolis +acceptance. Here, we’ve specified no Gibbs constraints, so the +acceptance will always be near 100%.

    +

    The output is an object of class redist.

    +
    +class(sims)
    +#> [1] "redist_plans" "tbl_df"       "tbl"          "data.frame"
    +

    The sims object includes various pieces of information +that were tracked while simulating, but we focus on +get_plans_matrix(sims), which is a matrix that contains the +plans.

    +
    +dim(get_plans_matrix(sims))
    +#> [1]  99 101
    +

    Checking the dimensions shows that each plan is saved as a column, +where each row is a precinct. From this, we can extract a single plan as +we would from a normal matrix, like below, where we plot the final +simulated plan.

    +
    +redist.plot.map(shp = iowa, plan = get_plans_matrix(sims)[, 100])
    +

    +

    Now, this plan is incredibly non-compact, which can be an issue. +However, we should expect this type of outcome, as we didn’t include a +compactness constraint while simulating. Thus, the only things checked +were contiguity and that no plan would be outside of the +pop_tol set above. Since there are many more non-compact +plans than compact plans in the space of all redistricting plans, we end +up with highly non-compact districts. We can fix this by specifying a +constraint, as below:

    +
    constr <- redist_constr(map_ia) %>% add_constr_edges_rem(0.4)
    +
    +sims_comp <- redist_flip(map_ia, nsims = 100, constraints = constr)
    +#> 
    +#> 
[36m──
[39m 
[1m
[31mredist_flip()
[39m
[22m 
[36m───────────────────────────────────────────────────────────────
[39m
    +#> 
    +#> ── 
[1m
[1m
[31mAutomated Redistricting Simulation Using Markov Chain Monte Carlo
[39m
[1m
[22m ──
    +#> 
[36mℹ
[39m Preprocessing data.
    +#> 
[36mℹ
[39m Starting swMH().
    +#> 
    +
[32m■                               
[39m   1% | ETA: 0s
    +
    +
[32m■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 
[39m 100% | ETA:  0s | MH Acceptance: 0.61
    +

    The first arguments as the same, but this adds three key arguments. +First, setting constraint to any combination of the nine +implemented constraints allows us to specify the target distribution. +Setting constraintweights = 0.4 means that we want to put a +relatively weak weight on the compactness, though a weak constraint +still does a lot of work. There are four compact +constraints implemented currently. The recommended is to use +edges-removed because it can be calculated very +quickly.

    +

    If we plot the final map sampled from the above code, we can see that +it is far more compact.

    +
    +redist.plot.map(shp = iowa, plan = get_plans_matrix(sims_comp)[, 100])
    +

    +

    Back to top

    +
    +
    +

    Using Multiple Chains +

    +

    When running larger redistricting analyses, one important step is to +run multiple chains of the MCMC algorithm. This will also allow us to +diagnose convergence better, using the Gelman-Rubin plot, as seen in the +section on Diagnostic Plots.

    +

    On Windows and in smaller capacities, it is useful to run the +algorithm within an lapply loop. First, we set up the seed +for replicability and decide on the number of chains and +simulations.

    +
    +set.seed(1)
    +nchains <- 4
    +nsims <- 100
    +

    Here, we opt to initialize using the SMC algorithm. When +we want to initialize without providing an initial partition, we need to +specify the number of districts, ndists.

    +
    +constr <- redist_constr(map_ia) %>% add_constr_edges_rem(0.4)
    +map_ia <- redist_map(iowa, ndists = 4, pop_tol = 0.05)
    +flip_chains <- lapply(1:nchains, function(x){
    +  redist_flip(map_ia, nsims = nsims,
    +              constraints = constr, verbose = FALSE)
    +})
    +

    In Unix-based systems, this can be run considerably faster by running +this in parallel.

    +
    +mcmc_chains <- parallel::mclapply(1:nchains, function(x){
    +  redist_flip(map_ia, nsims = nsims,
    +              constraints = constr, verbose = FALSE)
    +}, mc.set.seed = 1, mc.cores = parallel::detectCores())
    +

    Back to top

    +
    +
    +

    Tidy Flip MCMC using redist_flip() +

    +

    The new, tidy interface to functions with redist +introduces a pair of key objects, redist_map and +redist_plans. The Get Started +page goes into depth about these, but this shows the basics of how +to work with the flip algorithm within the newer +interface.

    +

    As in the standard interface, we need a data set to work with. This +example will also follow with using the included Iowa data.

    +
    +data(iowa)
    +

    Rather than building the adjacency graph manually, here we can set +this up using redist_map which will build it an add it as a +column.

    +
    +iowa_map <- redist_map(iowa, existing_plan = cd_2010, pop_tol=0.01)
    +

    We set a population tolerance of 1%. While this is generally a good +population parity tolerance for most simulations, be careful when using +the default within flip. If your starting partition sits +outside of that population deviation, flip may take a +very, very long time to find a valid partition to +flip.

    +

    Now, we can pass the redist_map object to +redist_flip to begin simulating.

    +
    tidy_sims <- redist_flip(iowa_map, nsims = 100)
    +#> 
    +#> 
[36m──
[39m 
[1m
[31mredist_flip()
[39m
[22m 
[36m───────────────────────────────────────────────────────────────
[39m
    +#> 
    +#> ── 
[1m
[1m
[31mAutomated Redistricting Simulation Using Markov Chain Monte Carlo
[39m
[1m
[22m ──
    +#> 
[36mℹ
[39m Preprocessing data.
    +#> 
[36mℹ
[39m Starting swMH().
    +#> 
    +
[32m■                               
[39m   1% | ETA: 0s
    +
    +
[32m■■■■■■■■■■■■■■■■■■■■■■■■        
[39m  77% | ETA:  0s | MH Acceptance: 0.79
    +
    +
[32m■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 
[39m 100% | ETA:  0s | MH Acceptance: 0.80
    +

    redist_flip’s constraint includes a relatively weak +compactness constraint by default because simulating compact maps is far +more efficient and completely non-compact maps are not super useful for +most purposes.

    +

    You can override this by making a blank redist_constr +object

    +
    +cons <- redist_constr(iowa_map)
    +

    Then, you can pass this to redist_flip.

    +
    tidy_sims_no_comp <- redist_flip(iowa_map, nsims = 100, constraints = cons)
    +#> 
    +#> 
[36m──
[39m 
[1m
[31mredist_flip()
[39m
[22m 
[36m───────────────────────────────────────────────────────────────
[39m
    +#> 
    +#> ── 
[1m
[1m
[31mAutomated Redistricting Simulation Using Markov Chain Monte Carlo
[39m
[1m
[22m ──
    +#> 
[36mℹ
[39m Preprocessing data.
    +#> 
[36mℹ
[39m Starting swMH().
    +#> 
    +
[32m■■■■■■■■■■■                     
[39m  34% | ETA:  0s | MH Acceptance: 1.00
    +
    +
[32m■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 
[39m 100% | ETA:  0s | MH Acceptance: 0.97
    +

    redist_flip outputs a redist_plans +object.

    +
    +class(tidy_sims)
    +#> [1] "redist_plans" "tbl_df"       "tbl"          "data.frame"
    +

    To extract the plans, use get_plans_matrix().

    +
    +plans <- get_plans_matrix(tidy_sims)
    +

    Alternatively, you can directly use functions on the +redist_plans object. For example, if we want to measure the +competitiveness of each plan:

    +
    +tidy_sims <- tidy_sims %>% 
    +  mutate(competitiveness = compet_talisman(pl(), iowa_map, rvote = rep_08, dvote = dem_08))
    +
    +tidy_sims %>% 
    +  ggplot(aes(x = competitiveness)) +
    +  geom_density() + 
    +  theme_bw()
    +

    +

    For more information on using redist_plans objects, see +the Get Started page.

    +

    Back to top

    +
    +
    +

    Diagnostic Plots +

    +

    When using the MCMC algorithms, there are various useful diagnostic +plots. The redist.diagplot function creates familiar plots +by converting numeric entries into mcmc objects to use with +coda.

    +

    We use the dissimilarity index in Massey and Denton 1988 as a summary +statistic for the following examples. This can be computed with +seg_dissim. In this case, we create a Republican +dissimilarity index. We can work with two examples, the first is a +single vector of the segregation index, while the second is a list of +vectors, with one vector for each chain.

    +
    +seg <- by_plan(seg_dissim(tidy_sims, iowa_map, rep_08, pop))
    +

    The first three plots only need a single index.

    +
      +
    • Autocorrelation Plot
    • +
    +
    +redist.diagplot(seg, plot = "autocorr")
    +

    +
      +
    • Density Plot
    • +
    +
    +redist.diagplot(seg, plot = "densplot")
    +

    +
      +
    • Mean Plot
    • +
    +
    +redist.diagplot(seg, plot = "mean")
    +

    +

    As examples for the next two plots, we can use the example above +which ran 4 chains. This is the same index, but computed for each +chain.

    +
    +seg_chains <- lapply(1:nchains, function(i) { 
    +    seg_dissim(flip_chains[[i]], iowa_map, rep_08, pop)
    +})
    +
      +
    • Trace Plot
    • +
    +
    +redist.diagplot(sumstat = seg_chains, plot = "trace")
    +

    +
      +
    • Gelman Rubin Plot
    • +
    +
    +redist.diagplot(sumstat = seg_chains, plot = 'gelmanrubin')
    +

    +

    Back to top

    +
    +
    +

    Tuning Flip Constraints +

    +

    When using the flip algorithm, the most important and +difficult step is setting the right constraint weights. While there may +be some general pieces of advice for doing so, no advice can replace +working with your data. The bottom line is that every data set is a bit +different. What works for one state’s redistricting process, with the +data specific to that state at that time may not transfer to another +state or municipality or school district. The general process of finding +what works might be very similar, but getting the right set of +constraint weights and other parameters will vary immensely. Even +starting from a different plan within the same time and place can change +the weights that perform best. Like most things, the key to tuning +flip is patience. Going for a full scale simulation without +testing some parameter configurations is likely an inefficient use of +time and computing power.

    +

    The following highlights some advice on how to tune flip +to make it work for your particular redistricting problem. For the +advice, we’ll use the following example:

    +
    data(iowa)
    +iowa_map <- redist_map(iowa, existing_plan = cd_2010, pop_tol = 0.02, total_pop = pop)
    +
    +cons <- redist_constr(iowa_map) %>% 
    +    add_constr_edges_rem(0.5) %>% 
    +    add_constr_pop_dev(100)
    +
    +sims <- redist_flip(map = iowa_map,  nsims = 100)
    +#> 
    +#> 
[36m──
[39m 
[1m
[31mredist_flip()
[39m
[22m 
[36m───────────────────────────────────────────────────────────────
[39m
    +#> 
    +#> ── 
[1m
[1m
[31mAutomated Redistricting Simulation Using Markov Chain Monte Carlo
[39m
[1m
[22m ──
    +#> 
[36mℹ
[39m Preprocessing data.
    +#> 
[36mℹ
[39m Starting swMH().
    +#> 
    +
[32m■                               
[39m   1% | ETA: 0s
    +
    +
[32m■■■■■■■■■■■■■■■■■■              
[39m  58% | ETA:  0s | MH Acceptance: 0.60
    +
    +
[32m■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 
[39m 100% | ETA:  0s | MH Acceptance: 0.55
    +
    +

    Acceptance Ratios +

    +

    One of the first things to check when working with flip +is the Metropolis Hastings ratio. It is printed to the console when +verbose = TRUE. If you have silenced printing or warnings, +the output saves the Metropolis Hastings decisions. You can check the +acceptance ratio in a redist_plans object with

    +
    +mean(sims$mhdecisions, na.rm = TRUE)
    +#> [1] 0.55
    +

    Reference plans included in the object will not have an +mhdecision, so you can remove them with +na.rm = TRUE.

    +

    The goal is to generally have the Metropolis Hastings ratio lie +between 20% and 40%. If simulating with only a single parameter, the +goal is generally to be near 40%, while with many parameters, you likely +want to be near 20%. If over the course of many simulations you find +yourself just above or just below, that probably isn’t a problem if the +simulations are in the right probability space.

    +
    +
    +

    +lambda and eprob +

    +

    lambda and eprob both control the amount of +movement within flip. They can be very powerful things to +increase. lambda defaults to 0, while eprob +defaults to 0.05. Each of these parameters leads to fairly small +movements between sequential iterations of the algorithm.

    +
    +sims_new <- redist_flip(map = iowa_map, nsims = 100, constraints = cons, 
    +                        eprob = 0.10, lambda = 2, verbose = FALSE)
    +mean(sims_new$mhdecisions, na.rm = TRUE)
    +#> [1] 0.46
    +

    In this example, we’ve increased each of these. +lambda = 2, up from its default of 0, while +eprob = 0.10, up from its default of 0.05. +What’s going on here can characterized fairly well by the Hamming +distance between sequential runs.

    +
    +dists <- redist.distances(plans = get_plans_matrix(sims))$Hamming
    +dists_new <- redist.distances(plans = get_plans_matrix(sims_new))$Hamming
    +adj_dists <- rep(NA_integer_, 100)
    +adj_dists_new <- rep(NA_integer_, 100)
    +for(i in 1:100){
    +  adj_dists[i] <- dists[i, i + 1]
    +  adj_dists_new[i] <- dists_new[i, i + 1]
    +}
    +tibble(Hamming = c(adj_dists, adj_dists_new), 
    +       `lambda/eprob` = c(rep('0/0.05', 100), rep('2/0.10', 100))) %>% 
    +  ggplot() + 
    +  geom_density(aes(x = Hamming, color = `lambda/eprob`)) + 
    +  theme_bw()
    +

    +

    lambda controls the number of components swapped between +each iterations, while eprob controls the size of the +swapped partitions. Increasing each of this values can be important for +increasing the amount of movement between outputted plans. These can be +adjusted automatically using adapt_lambda and +adapt_lambda when starting a simulation, though adjusting +them manually to fit your problem is better practice, as it leads to +more control over the process.

    +
    +
    +

    Adjusting pop_tol +

    +

    Sometimes a starting map sits in a neighborhood of maps that isn’t +very conducive to using it as a starting point. This is most often +characterized by running a single iteration that runs (seemingly) +forever. A typical fix for this is to weaken the population tolerance +and use a Gibbs constraint to pull the simulations back into the target +range. I’ve done this for the tuning example, even though it’s +unnecessary.

    +

    After simulating, if there is a hard constraint to consider, we can +check the parities:

    +
    +sims <- sims %>% mutate(par = plan_parity(map = iowa_map))
    +

    And then we can subset to the correct space.

    +
    +sims <- sims %>% filter(par <= 0.01)
    +

    With the right set of parameters, this will lead to a reasonable set +of simulations. In this case, we end up with about 10% of the +simulations when using a soft constraint, which is not uncommon. In +general, you want to aim for as low as a hard population parity as +possible, while using a strong weight on the Gibbs population when the +hard constraint is above what’s necessary. This helps maximize the +efficiency of your simulations, while allowing for additional movement +between neighborhoods of valid plans.

    +
    +
    +

    Balancing Multiple Constraints +

    +

    More often than not, there are multiple constraints that are +important to a redistricting problem. There are two general paths to +success when working with more than one or two constraints.

    +

    First, you might want to add one at a time, generally starting with +the compactness constraint. If flip doesn’t consider +compactness at all, it has an unfortunate behavior of creating +incredibly non-compact maps. However, with even a very weak compactness +constraint, it performs very well in avoiding those maps that are so +non-compact that they aren’t worthy of consideration. Then you can add +the next constraints once at a time, weakening them a bit each time you +add a new constraint. As above, you want to make sure that your +acceptance rate is between 20% and 40%. If it’s too low, you won’t get +sufficient movement around the probability space and if it’s too high, +you likely aren’t characterizing the probability space you want to +characterize.

    +

    The other way to tune is to run a simulation with a kitchen sink type +set up.

    +
    +cons <- redist_constr(iowa_map) %>% 
    +    add_constr_edges_rem(0.25) %>% 
    +    add_constr_pop_dev(50) %>% 
    +    add_constr_compet(10, rvote = rep_08, dvote = dem_08) %>% 
    +    add_constr_splits(10, admin = region)
    +

    Then we can run this for a relatively small number of iterations.

    +
    sims <- redist_flip(iowa_map, 100, constraints = cons)
    +#> 
    +#> 
[36m──
[39m 
[1m
[31mredist_flip()
[39m
[22m 
[36m───────────────────────────────────────────────────────────────
[39m
    +#> 
    +#> ── 
[1m
[1m
[31mAutomated Redistricting Simulation Using Markov Chain Monte Carlo
[39m
[1m
[22m ──
    +#> 
[36mℹ
[39m Preprocessing data.
    +#> 
[36mℹ
[39m Starting swMH().
    +#> 
    +
[32m■                               
[39m   1% | ETA: 0s
    +
    +
[32m■■■■■■■■■■■■■■■■■■■■■■■■■■■■■   
[39m  93% | ETA:  0s | MH Acceptance: 0.77
    +
    +
[32m■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 
[39m 100% | ETA:  0s | MH Acceptance: 0.75
    +

    Now, the interesting this here is that adding more constraints +actually increased the acceptance probability. This is because +correlated constraints can guide the algorithm towards high probability +neighborhoods where there are multiple maps which could be considered! +To address this, we might want to increase the constraint weight +slightly across the board. Had the weights been far too low, we might +lower them, particularly on constraints that we are not too worried +about.

    +
    +cons <- cons <- redist_constr(iowa_map) %>% 
    +    add_constr_edges_rem(1.5) %>% 
    +    add_constr_pop_dev(100) %>% 
    +    add_constr_compet(40, rvote = rep_08, dvote = dem_08) %>% 
    +    add_constr_splits(20, admin = region)
    +
    +sims <- redist_flip(iowa_map, 100, constraints = cons)
    +#> 
    +#> ── redist_flip() ───────────────────────────────────────────────────────────────
    +#> 
    +#> ── Automated Redistricting Simulation Using Markov Chain Monte Carlo ──
    +#>  Preprocessing data.
    +#>  Starting swMH().
    +

    For example, this new set of constraints might be a good place to +simulate at.

    +

    Notably, the process of tuning should be guided by the constraint +outputs and their relative values. The average compactness value of +edges removed that we’re constraining on has a summary like the +following:

    +
    +summary(sims$constraint_edges_removed, na.rm = TRUE)
    +#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
    +#>   33.00   36.00   36.50   38.18   41.00   46.00       4
    +

    The population constraint can be summarized as:

    +
    +summary(sims$constraint_pop_dev, na.rm = TRUE)
    +#>     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.     NA's 
    +#> 0.000007 0.000064 0.000129 0.000168 0.000215 0.000633        4
    +

    These are measured on completely different scales, so it shouldn’t be +surprising that population has a much higher weight. This is a constant +difficulty in tuning, as the total number of edges on a graph or the +volatility of the population isn’t something that’s easily standardized +and transferred between maps, unfortunately.

    +

    Back to top

    +
    +
    +
    +

    Some Final Thoughts +

    +

    Redistricting simulation is very much statistics rather than hard +science. When working with flip, or any redistricting +sampler, there will be a component that resembles art. Each important +variable needs to be included, but getting every variable to the correct +target space is not necessarily easy. In general, it may be best to +start with one or two constraints and slowly add them to the model. This +can help ensure that one single constraint doesn’t dominate the entire +process.

    +

    When starting off, it’s never a bad idea to run a single simulation +to make sure that everything works. If it doesn’t do what you’re +expecting, that’s much better than waiting for 1,000,000 iterations to +run. If that works, try 100 or 1000. Only once you’ve seen that it’s +moving and appears to be moving in reasonable directions should you try +for those large numbers of simulations. Remember that running 1,000,000 +steps of flip with completely useless parameters is not a +very good use of time or computing power.

    +

    And finally, when in doubt, it never hurts to run a few extra +simulations. Once you know that the code is working, it shouldn’t cost +much at all to run just a few extra iterations or a few simulations from +new starting points. If the results agree with your prior findings, +that’s more support for them. If they disagree, then you know what could +be wrong and can run even more additional simulations to figure out +what’s right!

    +

    Back to top

    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.7.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-11-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-11-1.png new file mode 100644 index 00000000..9a548839 Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-23-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-23-1.png new file mode 100644 index 00000000..47ce5241 Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-23-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-25-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-25-1.png new file mode 100644 index 00000000..d74e49a3 Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-25-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-26-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-26-1.png new file mode 100644 index 00000000..317b0b3a Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-26-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-27-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-27-1.png new file mode 100644 index 00000000..eea7d71b Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-27-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-29-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-29-1.png new file mode 100644 index 00000000..b412ad7a Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-29-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 00000000..b0c205f5 Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-30-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-30-1.png new file mode 100644 index 00000000..3ef1ad02 Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-30-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-34-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-34-1.png new file mode 100644 index 00000000..7913f699 Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-34-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-4-1.png new file mode 100644 index 00000000..7624c8b9 Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 00000000..a43fccfe Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/flip_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/flip_files/figure-html/unnamed-chunk-9-1.png new file mode 100644 index 00000000..062a91aa Binary files /dev/null and b/docs/articles/flip_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index 93fb753b..c83af47b 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ redist - 4.1.0 + 4.2.0

    @@ -38,13 +38,10 @@ Common Arguments to `redist` Functions
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • @@ -156,7 +153,7 @@

    The Mapking_shp = readRDS(data_path) print(king_shp) #> Simple feature collection with 2562 features and 10 fields -#> Attribute-geometry relationship: 3 constant, 5 aggregate, 2 identity +#> Attribute-geometry relationships: constant (3), aggregate (5), identity (2) #> Geometry type: MULTIPOLYGON #> Dimension: XY #> Bounding box: xmin: 1217170 ymin: 31464.84 xmax: 1583214 ymax: 287944.6 @@ -174,8 +171,8 @@

    The Map#> 8 330427 EXCALIBUR UNINCORP 7 660 501 402 164 151 0.00689 #> 9 333087 FED 30-3087 FED 7 820 645 453 223 124 0 #> 10 333238 FED 30-3238 FED 7 997 674 356 161 90 0 -#> # … with 2,552 more rows, and 1 more variable: -#> # geometry <MULTIPOLYGON [US_survey_foot]> +#> # ℹ 2,552 more rows +#> # ℹ 1 more variable: geometry <MULTIPOLYGON [US_survey_foot]>

    There are 39 incorporated cities in King County, which together cover 19% of the population and 19% of the area of the county. The remainder is “unincorporated King County”. The county contains a significant @@ -217,8 +214,8 @@

    Creating the redist_map obj #> 8 330427 EXCALIBUR UNINCORP 7 660 501 402 164 151 0.00689 #> 9 333087 FED 30-3087 FED 7 820 645 453 223 124 0 #> 10 333238 FED 30-3238 FED 7 997 674 356 161 90 0 -#> # … with 2,552 more rows, and 2 more variables: -#> # geometry <MULTIPOLYGON [US_survey_foot]>, adj <list> +#> # ℹ 2,552 more rows +#> # ℹ 2 more variables: geometry <MULTIPOLYGON [US_survey_foot]>, adj <list>

    This redist_map object contains an adjacency graph for the county. We can explore this graph, and zoom in on the city of Seattle, using plot().

    @@ -260,8 +257,8 @@

    Specific districts#> 8 331512 SEA 34-1512 SEA 8 379 307 262 200 33 0 #> 9 331517 SEA 34-1517 SEA 8 353 295 239 193 17 0 #> 10 331519 SEA 34-1519 SEA 8 407 328 282 211 44 0 -#> # … with 950 more rows, and 2 more variables: -#> # geometry <MULTIPOLYGON [US_survey_foot]>, adj <list> +#> # ℹ 950 more rows +#> # ℹ 2 more variables: geometry <MULTIPOLYGON [US_survey_foot]>, adj <list>

    Looking at the information in the header, and comparing it to the original king object, we see that the number of districts has been updated from 9 to 3, and the population tolerances have been @@ -321,19 +318,19 @@

    Merging#> To be partitioned into 9 districts with population between 214,505.7 - 1.663204% and 214,505.7 + 1.663204% #> Merged from another map with reindexing: int [1:2541] 41 41 46 41 41 ... #> # A tibble: 60 × 11 -#> distr city pct_w…¹ pop vap voters dem_08 rep_08 id preci…² adj -#> <int> <chr> <dbl> <int> <int> <dbl> <dbl> <dbl> <chr> <chr> <lis> -#> 1 1 BOT 0 17090 13312 9.89e3 5259 3017 3332… BOT 01… <int> -#> 2 1 KIR 0.0503 7036 5856 3.91e3 2191 947 3329… KIR 45… <int> -#> 3 1 KMR 0.0128 20460 15787 1.30e4 7288 3476 3306… KMR 32… <int> -#> 4 1 LFP 0.0281 12598 9975 9.46e3 6063 1992 3306… LFP 32… <int> -#> 5 1 SEA 0.00845 72503 59161 4.79e4 34664 6527 3323… SEA 46… <int> -#> 6 1 SHL 0.00447 53007 42873 3.43e4 20895 7184 3325… SHL 32… <int> -#> 7 1 UNINCORP 0.0536 24780 19208 1.54e4 8370 4440 3305… JEAN~C… <int> -#> 8 1 WOD 0.00260 8059 6163 4.79e3 2480 1505 3327… WOD 45… <int> -#> 9 2 SEA 0.0408 195293 162191 1.17e5 84203 10899 3318… SEA 43… <int> -#> 10 2 UNINCORP 0.0248 15645 11866 7.46e3 4654. 1211. 3309… RAINIE… <int> -#> # … with 50 more rows, and abbreviated variable names ¹​pct_water, ²​precinct +#> distr city pct_water pop vap voters dem_08 rep_08 id precinct adj +#> <int> <chr> <dbl> <int> <int> <dbl> <dbl> <dbl> <chr> <chr> <lis> +#> 1 1 BOT 0 17090 13312 9.89e3 5259 3017 3332… BOT 01-… <int> +#> 2 1 KIR 0.0503 7036 5856 3.91e3 2191 947 3329… KIR 45-… <int> +#> 3 1 KMR 0.0128 20460 15787 1.30e4 7288 3476 3306… KMR 32-… <int> +#> 4 1 LFP 0.0281 12598 9975 9.47e3 6063 1992 3306… LFP 32-… <int> +#> 5 1 SEA 0.00845 72503 59161 4.79e4 34664 6527 3323… SEA 46-… <int> +#> 6 1 SHL 0.00447 53007 42873 3.43e4 20895 7184 3325… SHL 32-… <int> +#> 7 1 UNIN… 0.0536 24780 19208 1.54e4 8370 4440 3305… JEAN~CE… <int> +#> 8 1 WOD 0.00260 8059 6163 4.79e3 2480 1505 3327… WOD 45-… <int> +#> 9 2 SEA 0.0408 195293 162191 1.17e5 84203 10899 3318… SEA 43-… <int> +#> 10 2 UNIN… 0.0248 15645 11866 7.46e3 4654. 1211. 3309… RAINIER… <int> +#> # ℹ 50 more rows

    Under the hood, merge_by() does several things. First, it groups the shapefile by the provided key or keys (here, city). By default it also groups by existing districts, so @@ -385,7 +382,7 @@

    Freezingis_county_split() function to identify split municipalities.

    -cat(redist.splits(king_land$distr, king_land$city), "split cities\n")
    +cat(splits_admin(king_land$distr, king_land, city), "split cities\n")
     #> 11 11 11 11 11 11 11 11 11 split cities
     
     king_land %>%
    @@ -414,7 +411,7 @@ 

    Freezing#> 8 1 101 KMR 0.0128 20460 15787 12954 7288 3476 <int [10]> #> 9 1 101 LFP 0.0281 12598 9975 9465 6063 1992 <int [4]> #> 10 1 101 SHL 0.00447 53007 42873 34346 20895 7184 <int [14]> -#> # … with 1,958 more rows

    +#> # ℹ 1,958 more rows

    The plot above shows which cities will be frozen together so that they cannot be split. Notice that we merge by not just unsplit_id but also city, so that adjacent @@ -431,7 +428,7 @@

    Freezingplans = redist_smc(king_unsplit, 100, silent=T) print(plans) #> A <redist_plans> containing 100 sampled plans and 1 reference plan -#> Plans have 9 districts from a 1968-unit map, and were drawn using Sequential +#> Plans have 9 districts from a 1,968-unit map, and were drawn using Sequential #> Monte Carlo. #> Merged from another map with reindexing: int [1:2541] 1410 1410 1414 1410 1410 ... #> With plans resampled from weights @@ -448,11 +445,11 @@

    Freezing#> 7 distr 7 214210 #> 8 distr 8 212491 #> 9 distr 9 217432 -#> 10 1 1 213311 -#> # … with 899 more rows +#> 10 1 1 217248 +#> # ℹ 899 more rows print(pullback(plans)) #> A <redist_plans> containing 100 sampled plans and 1 reference plan -#> Plans have 9 districts from a 2541-unit map, and were drawn using Sequential +#> Plans have 9 districts from a 2,541-unit map, and were drawn using Sequential #> Monte Carlo. #> With plans resampled from weights #> Plans matrix: int [1:2541, 1:101] 7 7 7 7 7 7 7 7 7 7 ... @@ -468,8 +465,8 @@

    Freezing#> 7 distr 7 214210 #> 8 distr 8 212491 #> 9 distr 9 217432 -#> 10 1 1 213311 -#> # … with 899 more rows +#> 10 1 1 217248 +#> # ℹ 899 more rows redist.plot.plans(pullback(plans), draws=1:4, shp=king_land)

    Notice how the Merged from another map... line @@ -554,7 +551,7 @@

    District Cores

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/map-preproc_files/figure-html/city-distr-plot-1.png b/docs/articles/map-preproc_files/figure-html/city-distr-plot-1.png index 1390f5ef..7d2934d5 100644 Binary files a/docs/articles/map-preproc_files/figure-html/city-distr-plot-1.png and b/docs/articles/map-preproc_files/figure-html/city-distr-plot-1.png differ diff --git a/docs/articles/map-preproc_files/figure-html/core-plans-1.png b/docs/articles/map-preproc_files/figure-html/core-plans-1.png index 796ddde5..32e51751 100644 Binary files a/docs/articles/map-preproc_files/figure-html/core-plans-1.png and b/docs/articles/map-preproc_files/figure-html/core-plans-1.png differ diff --git a/docs/articles/map-preproc_files/figure-html/cores-1.png b/docs/articles/map-preproc_files/figure-html/cores-1.png index ed03a300..35a726c5 100644 Binary files a/docs/articles/map-preproc_files/figure-html/cores-1.png and b/docs/articles/map-preproc_files/figure-html/cores-1.png differ diff --git a/docs/articles/map-preproc_files/figure-html/king-land-1.png b/docs/articles/map-preproc_files/figure-html/king-land-1.png index 5c52ccf5..eab3d708 100644 Binary files a/docs/articles/map-preproc_files/figure-html/king-land-1.png and b/docs/articles/map-preproc_files/figure-html/king-land-1.png differ diff --git a/docs/articles/map-preproc_files/figure-html/king-water-1.png b/docs/articles/map-preproc_files/figure-html/king-water-1.png index 3319d5b0..6243474d 100644 Binary files a/docs/articles/map-preproc_files/figure-html/king-water-1.png and b/docs/articles/map-preproc_files/figure-html/king-water-1.png differ diff --git a/docs/articles/map-preproc_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/map-preproc_files/figure-html/unnamed-chunk-6-1.png index ece5183b..29dc0760 100644 Binary files a/docs/articles/map-preproc_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/map-preproc_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/articles/map-preproc_files/figure-html/unsplit-plan-1.png b/docs/articles/map-preproc_files/figure-html/unsplit-plan-1.png index 309d6445..c4311678 100644 Binary files a/docs/articles/map-preproc_files/figure-html/unsplit-plan-1.png and b/docs/articles/map-preproc_files/figure-html/unsplit-plan-1.png differ diff --git a/docs/articles/map-preproc_files/figure-html/water-plot-1.png b/docs/articles/map-preproc_files/figure-html/water-plot-1.png index e9a4376b..51b89ead 100644 Binary files a/docs/articles/map-preproc_files/figure-html/water-plot-1.png and b/docs/articles/map-preproc_files/figure-html/water-plot-1.png differ diff --git a/docs/articles/redist.html b/docs/articles/redist.html index 292ed51c..16a1599a 100644 --- a/docs/articles/redist.html +++ b/docs/articles/redist.html @@ -40,7 +40,7 @@ redist - 4.1.0 + 4.2.0 @@ -63,13 +63,10 @@ Common Arguments to `redist` Functions
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • @@ -360,8 +357,9 @@

    Setting up the problem in redist #> 8 19015 Boone 4 26306 25194 202 505 20027 19448 103 260 13929 #> 9 19017 Brem… 1 24276 23459 186 239 18763 18242 155 137 12871 #> 10 19019 Buch… 1 20958 20344 59 243 15282 14979 32 128 10338 -#> # … with 89 more rows, and 5 more variables: dem_08 <dbl>, rep_08 <dbl>, -#> # region <chr>, geometry <MULTIPOLYGON [US_survey_foot]>, adj <list> +#> # ℹ 89 more rows +#> # ℹ 5 more variables: dem_08 <dbl>, rep_08 <dbl>, region <chr>, +#> # geometry <MULTIPOLYGON [US_survey_foot]>, adj <list>

    This looks much the same as iowa itself, but metadata has been added, and there’s a new column, adj.

    @@ -417,7 +415,7 @@

    Exploring the geography
    -areas = as.numeric(units::set_units(sf::st_area(iowa_map$geometry), mi^2))
    +areas = as.numeric(units::set_units(sf::st_area(iowa_map$geometry), mi^2))
     plot(iowa_map, fill = pop / areas) + 
         scale_fill_viridis_c(name="Population density (people / sq. mi)", 
                              trans="sqrt")
    @@ -465,25 +463,25 @@

    Simulating redistricting plansadd_reference().

     print(iowa_plans)
    -#> A <redist_plans> containing 1000 sampled plans and 1 reference plan
    +#> A <redist_plans> containing 1,000 sampled plans and 1 reference plan
     #> Plans have 4 districts from a 99-unit map, and were drawn using Sequential
     #> Monte Carlo.
     #> With plans resampled from weights
    -#> Plans matrix: int [1:99, 1:1001] 3 3 1 2 4 1 1 4 1 1 ...
    +#> Plans matrix: int [1:99, 1:1001] 1 1 2 3 4 2 2 4 2 2 ...
     #> # A tibble: 4,004 × 4
     #>    draw    district total_pop chain
     #>    <fct>      <int>     <dbl> <int>
    -#>  1 cd_2010        1    761548    NA
    -#>  2 cd_2010        2    761624    NA
    -#>  3 cd_2010        3    761612    NA
    +#>  1 cd_2010        1    761612    NA
    +#>  2 cd_2010        2    761548    NA
    +#>  3 cd_2010        3    761624    NA
     #>  4 cd_2010        4    761571    NA
    -#>  5 1              1    765390     1
    -#>  6 1              2    766481     1
    -#>  7 1              3    760381     1
    -#>  8 1              4    754103     1
    -#>  9 2              1    758248     1
    -#> 10 2              2    755611     1
    -#> # … with 3,994 more rows
    +#> 5 1 1 760836 1 +#> 6 1 2 757367 1 +#> 7 1 3 762946 1 +#> 8 1 4 765206 1 +#> 9 2 1 756071 1 +#> 10 2 2 765242 1 +#> # ℹ 3,994 more rows

    We can explore specific simulated plans with redist.plot.plans().

    @@ -504,7 +502,7 @@ 

    Analyzing the simulated plans
     iowa_plans = match_numbers(iowa_plans, iowa_map$cd_2010)
     print(iowa_plans)
    -#> A <redist_plans> containing 1000 sampled plans and 1 reference plan
    +#> A <redist_plans> containing 1,000 sampled plans and 1 reference plan
     #> Plans have 4 districts from a 99-unit map, and were drawn using Sequential
     #> Monte Carlo.
     #> With plans resampled from weights
    @@ -516,13 +514,13 @@ 

    Analyzing the simulated plans#> 2 cd_2010 2 761624 NA 1 #> 3 cd_2010 3 761612 NA 1 #> 4 cd_2010 4 761571 NA 1 -#> 5 1 1 766481 1 0.641 -#> 6 1 2 754103 1 0.641 -#> 7 1 3 760381 1 0.641 -#> 8 1 4 765390 1 0.641 -#> 9 2 1 758248 1 0.872 -#> 10 2 2 764095 1 0.872 -#> # … with 3,994 more rows

    +#> 5 1 1 765206 1 0.875 +#> 6 1 2 762946 1 0.875 +#> 7 1 3 757367 1 0.875 +#> 8 1 4 760836 1 0.875 +#> 9 2 1 756071 1 0.691 +#> 10 2 2 765242 1 0.691 +#> # ℹ 3,994 more rows

    Then we can add summary statistics by district, using redist’s analysis functions. Here, we’ll compute the population deviation, the perimeter-based compactness measure related to @@ -533,7 +531,7 @@

    Analyzing the simulated plansiowa_plans = iowa_plans %>% mutate(pop_dev = abs(total_pop / get_target(iowa_map) - 1), - comp = distr_compactness(iowa_map, "PolsbyPopper", perim_df=county_perims), + comp = comp_polsby(pl(), iowa_map, perim_df=county_perims), pct_min = group_frac(iowa_map, vap - wvap, vap), pct_dem = group_frac(iowa_map, dem_08, dem_08 + rep_08)) print(iowa_plans) @@ -546,13 +544,13 @@

    Analyzing the simulated plans#> 2 cd_2010 2 761624 NA 1 0.0000463 0.360 0.0968 0.579 #> 3 cd_2010 3 761612 NA 1 0.0000305 0.529 0.114 0.531 #> 4 cd_2010 4 761571 NA 1 0.0000233 0.522 0.0788 0.491 -#> 5 1 1 766481 1 0.641 0.00642 0.436 0.0714 0.592 -#> 6 1 2 754103 1 0.641 0.00983 0.350 0.0975 0.581 -#> 7 1 3 760381 1 0.641 0.00159 0.263 0.118 0.556 -#> 8 1 4 765390 1 0.641 0.00499 0.395 0.0765 0.461 -#> 9 2 1 758248 1 0.872 0.00439 0.392 0.0851 0.617 -#> 10 2 2 764095 1 0.872 0.00329 0.313 0.0846 0.546 -#> # … with 3,994 more rows +#> 5 1 1 765206 1 0.875 0.00475 0.468 0.0665 0.594 +#> 6 1 2 762946 1 0.875 0.00178 0.439 0.0963 0.579 +#> 7 1 3 757367 1 0.875 0.00554 0.247 0.118 0.541 +#> 8 1 4 760836 1 0.875 0.000988 0.588 0.0831 0.477 +#> 9 2 1 756071 1 0.691 0.00725 0.481 0.0791 0.594 +#> 10 2 2 765242 1 0.691 0.00480 0.274 0.0895 0.585 +#> # ℹ 3,994 more rows

    Once summary statistics of interest have been calculated, it’s very important to check the algorithm’s diagnostics. As with any complex sampling algorithm, things can go wrong. Diagnostics, while not @@ -563,25 +561,25 @@

    Analyzing the simulated plans
     summary(iowa_plans)
     #> SMC: 1,000 sampled plans of 4 districts on 99 units
    -#> `adapt_k_thresh`=0.985 • `seq_alpha`=0.5
    +#> `adapt_k_thresh`=0.99 • `seq_alpha`=0.5
     #> `est_label_mult`=1 • `pop_temper`=0
    -#> Plan diversity 80% range: 0.50 to 0.82
    +#> Plan diversity 80% range: 0.45 to 0.81
     #> 
     #> R-hat values for summary statistics:
     #> pop_overlap     pop_dev        comp     pct_min     pct_dem 
    -#>       1.002       1.010       1.000       1.002       1.009
    +#>       1.002       1.014       1.033       1.001       1.014
     #> Sampling diagnostics for SMC run 1 of 2 (500 samples)
     #>          Eff. samples (%) Acc. rate Log wgt. sd  Max. unique Est. k 
    -#> Split 1       492 (98.4%)      5.5%        0.26   322 (102%)      5 
    -#> Split 2       486 (97.3%)     10.1%        0.33   312 ( 99%)      3 
    -#> Split 3       480 (96.0%)      4.2%        0.42   275 ( 87%)      2 
    -#> Resample      416 (83.2%)       NA%        0.38   425 (134%)     NA
    +#> Split 1       492 (98.4%)      5.6%        0.25   316 (100%)      5 
    +#> Split 2       484 (96.8%)      7.5%        0.36   304 ( 96%)      4 
    +#> Split 3       476 (95.1%)      3.0%        0.44   272 ( 86%)      3 
    +#> Resample      402 (80.5%)       NA%        0.43   407 (129%)     NA
     #> Sampling diagnostics for SMC run 2 of 2 (500 samples)
     #>          Eff. samples (%) Acc. rate Log wgt. sd  Max. unique Est. k 
    -#> Split 1       491 (98.3%)      5.7%        0.26   309 ( 98%)      5 
    -#> Split 2       483 (96.5%)      9.7%        0.39   309 ( 98%)      3 
    -#> Split 3       478 (95.7%)      4.4%        0.42   283 ( 90%)      2 
    -#> Resample      408 (81.5%)       NA%        0.39   429 (136%)     NA
    +#> Split 1       491 (98.3%)      5.6%        0.26   309 ( 98%)      5 
    +#> Split 2       484 (96.8%)      6.8%        0.36   297 ( 94%)      4 
    +#> Split 3       480 (96.1%)      2.9%        0.42   264 ( 84%)      3 
    +#> Resample      425 (85.0%)       NA%        0.39   424 (134%)     NA
     #> •  Watch out for low effective samples, very low acceptance rates (less than
     #> 1%), large std. devs. of the log weights (more than 3 or so), and low numbers
     #> of unique plans. R-hat values for summary statistics should be between 1 and
    @@ -609,7 +607,7 @@ 

    Analyzing the simulated plans= max(pct_min), dem_distr = sum(pct_dem > 0.5)) print(plan_sum) -#> A <redist_plans> containing 1000 sampled plans and 1 reference plan +#> A <redist_plans> containing 1,000 sampled plans and 1 reference plan #> Plans have 4 districts from a 99-unit map, and were drawn using Sequential #> Monte Carlo. #> With plans resampled from weights @@ -618,16 +616,16 @@

    Analyzing the simulated plans#> draw max_dev avg_comp max_pct_min dem_distr #> <fct> <dbl> <dbl> <dbl> <int> #> 1 cd_2010 0.0000535 0.428 0.114 3 -#> 2 1 0.00983 0.361 0.118 3 -#> 3 2 0.00894 0.438 0.115 3 -#> 4 3 0.00322 0.426 0.128 3 -#> 5 4 0.00322 0.426 0.128 3 -#> 6 5 0.00468 0.401 0.126 3 -#> 7 6 0.00608 0.433 0.109 3 -#> 8 7 0.00910 0.380 0.113 3 -#> 9 8 0.00740 0.430 0.114 3 -#> 10 9 0.00810 0.504 0.110 3 -#> # … with 991 more rows

    +#> 2 1 0.00554 0.435 0.118 3 +#> 3 2 0.00725 0.413 0.113 3 +#> 4 3 0.00997 0.330 0.128 3 +#> 5 4 0.00457 0.365 0.121 3 +#> 6 5 0.00894 0.508 0.115 3 +#> 7 6 0.00889 0.406 0.119 3 +#> 8 7 0.00562 0.350 0.117 3 +#> 9 8 0.00921 0.407 0.110 3 +#> 10 9 0.00984 0.375 0.119 3 +#> # ℹ 991 more rows

    These tables of statistics are easily plotted using existing libraries like ggplot2, but redist provides a number of helpful plotting functions that automate some common tasks, @@ -665,7 +663,7 @@

    Analyzing the simulated plans
    -pal = scales::viridis_pal()(5)[-1]
    +pal = scales::viridis_pal()(5)[-1]
     redist.plot.scatter(iowa_plans, pct_min, pct_dem, 
                         color=pal[subset_sampled(iowa_plans)$district]) +
         scale_color_manual(values="black")
    @@ -719,7 +717,7 @@

    Analyzing the simulated plans

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/articles/redist_files/figure-html/dev-comp-plot-1.png b/docs/articles/redist_files/figure-html/dev-comp-plot-1.png index 8411e67a..33808d29 100644 Binary files a/docs/articles/redist_files/figure-html/dev-comp-plot-1.png and b/docs/articles/redist_files/figure-html/dev-comp-plot-1.png differ diff --git a/docs/articles/redist_files/figure-html/ia-sim-plans-1.png b/docs/articles/redist_files/figure-html/ia-sim-plans-1.png index b60af887..0dbb1ac0 100644 Binary files a/docs/articles/redist_files/figure-html/ia-sim-plans-1.png and b/docs/articles/redist_files/figure-html/ia-sim-plans-1.png differ diff --git a/docs/articles/redist_files/figure-html/iowa-adj-1.png b/docs/articles/redist_files/figure-html/iowa-adj-1.png index 0f153e5d..16bca13a 100644 Binary files a/docs/articles/redist_files/figure-html/iowa-adj-1.png and b/docs/articles/redist_files/figure-html/iowa-adj-1.png differ diff --git a/docs/articles/redist_files/figure-html/iowa-chloro-1.png b/docs/articles/redist_files/figure-html/iowa-chloro-1.png index f2c4b8f3..753316e4 100644 Binary files a/docs/articles/redist_files/figure-html/iowa-chloro-1.png and b/docs/articles/redist_files/figure-html/iowa-chloro-1.png differ diff --git a/docs/articles/redist_files/figure-html/iowa-chloro-2.png b/docs/articles/redist_files/figure-html/iowa-chloro-2.png index f53de927..30652936 100644 Binary files a/docs/articles/redist_files/figure-html/iowa-chloro-2.png and b/docs/articles/redist_files/figure-html/iowa-chloro-2.png differ diff --git a/docs/articles/redist_files/figure-html/iowa-chloro-3.png b/docs/articles/redist_files/figure-html/iowa-chloro-3.png index a41d7352..0710bd5f 100644 Binary files a/docs/articles/redist_files/figure-html/iowa-chloro-3.png and b/docs/articles/redist_files/figure-html/iowa-chloro-3.png differ diff --git a/docs/articles/redist_files/figure-html/scatter-1.png b/docs/articles/redist_files/figure-html/scatter-1.png index 645d8d3a..5ad9f63b 100644 Binary files a/docs/articles/redist_files/figure-html/scatter-1.png and b/docs/articles/redist_files/figure-html/scatter-1.png differ diff --git a/docs/articles/redist_files/figure-html/signature-1.png b/docs/articles/redist_files/figure-html/signature-1.png index 40882f8b..bc3301b6 100644 Binary files a/docs/articles/redist_files/figure-html/signature-1.png and b/docs/articles/redist_files/figure-html/signature-1.png differ diff --git a/docs/authors.html b/docs/authors.html index 6a4760fc..a05fdf21 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ redist - 4.1.0 + 4.2.0 @@ -38,13 +38,10 @@ Common Arguments to `redist` Functions
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • @@ -148,12 +145,9 @@

    Papers:

    Installation Instructions @@ -161,7 +155,7 @@

    Installation Instructionsredist is available on CRAN and can be installed using:

    -

    You can also install the most recent development version of redist (which is usually quite stable) using the `remotes`` package.

    +

    You can also install the most recent development version of redist (which is usually quite stable) using the remotes package.

     if (!require(remotes)) install.packages("remotes")
     remotes::install_github("alarm-redist/redist@dev", dependencies=TRUE)
    @@ -181,7 +175,7 @@

    Getting started# simulate 500 plans using the SMC algorithm iowa_plans = redist_smc(iowa_map, nsims=500) #> SEQUENTIAL MONTE CARLO -#> Sampling 500 99-unit maps with 4 districts and population between 760827 and 762350.

    +#> Sampling 500 99-unit maps with 4 districts and population between 760,827 and 762,350.

    After generating plans, you can use redist’s plotting functions to study the geographic and partisan characteristics of the simulated ensemble.

     library(ggplot2)
    @@ -192,9 +186,10 @@ 

    Getting started
     
     iowa_plans = iowa_plans %>%
    -    mutate(Compactness = distr_compactness(iowa_map),
    +    mutate(Compactness = comp_polsby(pl(), iowa_map),
                `Population deviation` = plan_parity(iowa_map),
                `Democratic vote` = group_frac(iowa_map, dem_08, tot_08))
    +#> Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE
     
     hist(iowa_plans, `Population deviation`) + hist(iowa_plans, Compactness) +
         plot_layout(guides="collect") +
    @@ -256,7 +251,7 @@ 

    Developers

    Dev status

      -
    • Build Status
    • +
    • R-CMD-check
    • CRAN_Status_Badge
    @@ -272,7 +267,7 @@

    Dev status

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.

    diff --git a/docs/news/index.html b/docs/news/index.html index bfcb8fe9..bbd46121 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ redist - 4.1.0 + 4.2.0

    @@ -38,13 +38,10 @@ Common Arguments to `redist` Functions
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints
  • - Map Pre-processing for Special Constraints -
  • -
  • - Redistricting with Flip MCMC + Redistricting with Flip MCMC
  • - MPI / Slurm Sample Scripts + Map Pre-processing for Special Constraints