redist.combine.mpi is used to combine successive runs of redist.mcmc.mpi into a single data object

redist.combine.mpi(savename, nloop, nthin, tempadj)

Arguments

savename

The name (without the loop or .RData suffix) of the saved simulations.

nloop

The number of loops being combined.

nthin

How much to thin the simulations being combined.

tempadj

The temperature adjacency object saved by redist.mcmc.mpi.

Value

redist.combine.mpi returns an object of class "redist". The object redist is a list that contains the following components (the inclusion of some components is dependent on whether tempering techniques are used):

plans

Matrix of congressional district assignments generated by the algorithm. Each row corresponds to a geographic unit, and each column corresponds to a simulation.

distance_parity

Vector containing the maximum distance from parity for a particular simulated redistricting plan.

mhdecisions

A vector specifying whether a proposed redistricting plan was accepted (1) or rejected (0) in a given iteration.

mhprob

A vector containing the Metropolis-Hastings acceptance probability for each iteration of the algorithm.

pparam

A vector containing the draw of the p parameter for each simulation, which dictates the number of swaps attempted.

constraint_pop

A vector containing the value of the population constraint for each accepted redistricting plan.

constraint_compact

A vector containing the value of the compactness constraint for each accepted redistricting plan.

constraint_vra

A vector containing the value of the vra constraint for each accepted redistricting plan.

constraint_similar

A vector containing the value of the similarity constraint for each accepted redistricting plan.

constraint_qps

A vector containing the value of the QPS constraint for each accepted redistricting plan.

beta_sequence

A vector containing the value of beta for each iteration of the algorithm. Returned when tempering is being used.

mhdecisions_beta

A vector specifying whether a proposed beta value was accepted (1) or rejected (0) in a given iteration of the algorithm. Returned when tempering is being used.

mhprob_beta

A vector containing the Metropolis-Hastings acceptance probability for each iteration of the algorithm. Returned when tempering is being used.

Details

This function allows users to combine multiple successive runs of redist.mcmc.mpi into a single redist object for analysis.

References

Fifield, Benjamin, Michael Higgins, Kosuke Imai and Alexander Tarr. (2016) "A New Automated Redistricting Simulator Using Markov Chain Monte Carlo." Working Paper. Available at http://imai.princeton.edu/research/files/redist.pdf.

Examples

if (FALSE) {
# Cannot run on machines without Rmpi
data(fl25)
data(fl25_enum)
data(fl25_adj)

## Code to run the simulations in Figure 4 in Fifield, Higgins, Imai and
## Tarr (2015)

## Get an initial partition
init_plan <- fl25_enum$plans[, 5118]

## Run the algorithm
redist.mcmc.mpi(adj = fl25_adj, total_pop = fl25$pop,
    init_plan = init_plan, nsims = 10000, nloops = 2, savename = "test")
out <- redist.combine.mpi(savename = "test", nloop = 2,
    nthin = 10, tempadj = tempAdjMat)
}