Skip to main content

Use Markov chain Monte Carlo to analyze districting plans and gerrymanders

Project description

Build Status Code Coverage Documentation Status

GerryChain is a Python library for building ensembles of districting plans using Markov chain Monte Carlo.

The basic workflow is to start with the geometry of an initial plan, perhaps one that is currently enacted in your state or municipality, and generate a large collection of sample plans for comparison. Usually, we will constrain these sampled plans in such a way that they perform at least as well as the initial plan according to traditional districting principles, such as population balance or compactness. Comparing the initial plan to the ensemble provides quantitative tools for measuring whether or not it is an outlier similar plans.

The development of this package began at the Voting Rights Data Institute as a Python rewrite of the chain C++ program, originally by Maria Chikina, Alan Frieze and Wesley Pegden for their paper “Assessing significance in a Markov chain without mixing.”

Getting started

See our Getting started guide for the basics of using GerryChain.

Installation

To install GerryChain from PyPI, just run pip install gerrychain.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

GerryChain-0.2.0.tar.gz (46.2 kB view hashes)

Uploaded Source

Built Distributions

gerrychain-0.2.0-py2.py3-none-any.whl (51.3 kB view hashes)

Uploaded Python 2 Python 3

GerryChain-0.2.0-py2.py3-none-any.whl (51.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page