Git Product home page Git Product logo

relogit's Introduction

relogit

A simple wrapper class to estimate a Rare Event Logit model of King and Zeng (2001) in Python.

Warning:

  • This module is provided 'as is' and is prone to errors.

User guide:

– In a terminal window install the requirements as:

pip install -r requirements.txt

– In Python environment import the relogit module as:

from relogit import relogit

– Specify the function using the following variables:

Y : array_like
            A 1-d endogenous response variable. See statsmodels guidance.
            
X : array_like
            A nobs x k array where nobs is the number of observations and k is 
            the number of regressors. An intercept is added by setting add_const
            to True.
            
add_const : Boolean, optional
            Whether to add a constant into X. The default is False.
            
disp : Boolean, optional
            Whether to display details for fitting. The default is False.
            See statsmodels guidance  

– Train a RE-Logit model by

relogit_model=relogit(Y, X, *optional keywords*)

– Get estimations of unbiased probability predicted_relogit and unbiased coefficients coeffs_unbiased by RE-Logit for a new set of exogenous set X_test as:

predicted_relogit,coeffs_unbiased = relogit_model.predict(X_test)

– Get additional estimations of probability predicted_logit and coefficients coeff_biased by the Logit for the same input X_test as:

predicted_relogit,coeffs_unbiased,predicted_logit,coeff_biased = relogit_model.predict(X_test)

– For more see the accompanying example script vignette.py

Packages

The following packages are required to use this module:

  • Numpy
  • statsmodels

relogit's People

Contributors

hkalager avatar

Stargazers

Monte Lubowitz avatar  avatar

Watchers

 avatar

Forkers

kehilbert

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.