This vignette introduces some of the most common measures of some
basic measures of the distance between plans. This offers a quick look
at how similar or different a pair of plans are. See the vignette “Using
redistmetrics
” for the bare-bones of the package.
We first load the redistmetrics
package and data from
New Hampshire. For any function, the shp
argument can be
swapped out for your data, pop
for your population, and the
plans
argument can be swapped out for your redistricting
plans (be it a single plan, a matrix of plans, or a
redist_plans
object).
Note that, when computing distance between plans, you always want to
provide more than one plan. For that reason, we will also load
nh_m
, a matrix of plans for New Hampshire.
We subset it to its first four columns (the first four plans).
The recommended distance between plans is the variation of information. This considers the distance between plans by looking at the joint distributions of people across plans.
The Variation of Information can be computed with:
The Hamming distance is a simpler metric which just considers how many units are assigned to different districts between pairs of plans.
The Hamming distance can be computed with:
The Manhattan distance measures how many “blocks” you would need to move to get between plans. This is most useful in MCMC contexts, rather than general contexts.
The Manhattan distance can be computed with:
The Euclidean distance measures the square root of the summed distances you would need to move to get between plans. This is most useful in MCMC contexts, rather than general contexts.
The Euclidean distance can be computed with: