Giter Site home page Giter Site logo

polisci's Introduction

polisci

Political Science in Python

This project will mostly be about reimplementing my undergraduate dissertation in Python with a re-usable library, which can then serve as a basis of further research by myself or others. The original source code in C# and R is available on GitHub https://github.com/mfow/uoa-political-science

Abstract

It is claimed in (Carey and Hix, 2011) that the trade-off between expected fairness and stability in election systems is non-linear and that small medium sized District Magnitudes are optimal, based on outcomes of elections in the real world. Does this apply in general or can this effect be explained by other factors? We test the hypothesis that the trade-off is non-linear against artificial societies and across a range of voting systems. We use the Spatial Model, Polya Eggenberger Model and a preference swapping model and the STV, District Proportional and SM rules. Our results show clearly that there is non-linearity in this trade-off however the shape of the curve differs greatly depending on the system we use. We compare these different outcomes under a range of different undesirability functions that value the properties differently. We find that a District Magnitude of DM = 3, DM = 8 or DM = 20 is optimal, depending on how the properties are valued with respect to each other.

Political Power

Represents the percentage of time that a particular party has the deciding vote. In reality there are issues with this model since it doesn't consider how some parties will tend to vote the same way on many issues.

This is an expensive computation to compute as it has O(n!) complexity to evaluate correctly. We can approximate it using monte carlo methods.

As an alternative, a Tensor Flow model has been trained to approximate this function.

Measures

Unfairness and instability are both loss functions for elections. We want to minimize each. Unfortunately it is difficult to minimize both at the same time.

Unfairness measures

  • Loosemorehanby index
  • Gallagher index

Instability measures

  • Effective number of parties (seats, or power)

Societies

We define models for societies whereby we can compute batches of votes with preference and weight data.

Spatial Model

Defines parties, electorates, and voters to exist in n dimensional space. Voters in a given electorate are centered around the electorate centroid. The standard deviations of each can be varied on a per dimension basis. Voters prefer parties that are closer to them by Minkowski distance.

This could be extended to have parties represented by a cluster of points rather than a single point. The distance between a voter and a party would be the minimum distance to any of the centroids for that party. The electorates could be represented by a cluster of points.

polisci's People

Contributors

mfow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

polisci's Issues

Implement STV

Implement Single Transferrable Vote voting system. This system depends on preferences.

Implement framework for election systems and FPP

Add an extensible base class for election systems, and implement first past the post.

The framework should be extensible for systems that require preference orders as well as those that simply require first preferences.

Implement MMP

Implement the MMP voting system.

This is a special case since voters are voting in multiple electorates (for list MPs + local MPs).

Implement model to infer preference swapping likelihoods

This is an extension of the original dissertation.

There are two main steps to this.

  1. given real world data + real world preference swapping data, we fit the dataset to the spatial model and then work out a suitable function to determine likelihood of preference swapping based on relative distance between voters and parties.

  2. We fit real world data to the spatial model, then use the function for inferring preference swapping.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.