GithubHelp home page GithubHelp logo

bayesian-probit's Introduction

Bayesian Estimation of a Probit Regression Model

This repository contains the code related to our final project for class 20592 Statistics and Probability at Bocconi University. The project aims at illustrating the use of Bayesian methods for estimating the coefficient of a probit regression model for binary outcomes. In particular, the code in this repository implements the Metropolis algorithm and the auxiliary variable Gibbs sampler and runs simulations to show how they can be used to estimate the coefficients of a probit regression model.

Content

The current repository is structured as follows:

  • data/finney47.csv: dataset used for testing the methods implemented in metropolis.py and gibbs.py (TODO: add citation);
  • images/: contain trace plots and distribution plots obtained from the simulations in gibbs_simulation.py and metropolis_simulation.py;
  • project/:
    • base.py: implements BaseBayesianProbit class;
    • gibbs.py: implements auxiliary variable Gibbs sampler in GibbsProbit class;
    • metropolis.py: implements Metropolis algorithm in MetropolisProbit class;
    • utils.py: implements utility functions for loading the data and obtaining the plots shown in images;
  • bayesian_probit.pdf: final PDF report;
  • gibbs_simulation.py: main simulation script for testing the auxiliary variable Gibbs sampler;
  • metropolis_simulation.py: main simulation script for testing the Metropolis algorithm;
  • README.md;
  • requirements.txt.

Requirements

The Python packages required to run the simulations can be installed from withing the repository by using the pip package manager:

pip install -r requirements.txt

Simulations

The simulations performed for the project can be replicated by running:

python gibbs_simulation.py
python metropolis_simulation.py

If not already present in images/, new trace plots and distribution plots for the coefficients of the probit model sampled by the two methods mentioned above are generated and stored.

Authors

bayesian-probit's People

Contributors

danielemiche avatar stefanocortinovis avatar

Watchers

 avatar

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.