Code Monkey home page Code Monkey logo

bdm-scholz-expected-utility-model's Introduction

BDM/Scholz Expected Uility Model

A Python implementation of Scholz, Calbert & Smith (2011), an attempt to replicate Bruce Bueno de Mesquita's expected utility model for political forecasting.

Original: https://github.com/jmckib/bdm-scholz-expected-utility-model

Changes by David Masad:

  • Update to Python 3
  • Make terminal output optional
  • Enable logging to file

Files

  • bdm_scholz_model.py: The model code itself.
  • ExampleActors.csv: Actors from the Scholz et al. paper
  • Sultan.csv: Actors from the 'Sultan' dataset (1997?)
  • Example.log: Model output generated by running the model with the ExampleActors.csv actors.
  • Example Analysis.ipynb: Jupyter Notebook demonstrating running the model interactively, and showing a sensitivity analysis.

Command line

usage: python bdm_scholz_model.py [-h] [--verbose] [--log LOG] csv_path num_rounds

positional arguments:

csv_path: Path to csv with input data

num_rounds: Number of rounds of simulation to run

optional arguments:

-h, --help: show this help message and exit

--verbose: Output the model dynamics to the terminal.

--log: Path to log the model run to.

example:

python bdm_scholz_model.py ExampleActors.csv 10 --verbose --log Example.log

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.