Monday, June 26, 2017

Several more models for Statsmodels

Hi everyone!

Two weeks ago i started implementing Generic Zero Inflated model with Zero Inflated Poisson model.

And what's results?
Zero Inflated Poisson model works very well(thanks to Generic Zero Inflated).

Generic Zero Inflated model allows to implement new models very fast. New model require only object of main model(not inflated) and only 1/4 implementation of hessian. Another parts like score, fit, 3/4 hessian is derived from Generic Zero Inflated model and don't required reimplementation.

The next model will be GenericTruncated and TruncatedPoisson. Parts of this model has implemented already. Here is the results:
Stata:























My implementation:




















Truncated model require additional work, because there's some problem with truncation > 1. More little time and it will be fixed.

So, work is go on ;-)

Monday, June 12, 2017

First post at GSoC 2017 with StatsModels and results of first two weeks.

Hello!

My name's Evgeny.
My project for this summer is adding maximum likelihood models for distributions line Generalized Poisson, Zero-Inflated Poisson, Zero-Inflated Negative Binomial, Poisson Inverse Gaussian and many others(more about maximum likelihood estimation).

Community bonding period was spent to familiarize with this models and look through source code for existing models.

Each model includes the main following components:

  • Loglikelihood function
  • Analytic first and second derivatives(Score and Hessian)
  • Method to predict parameters
  • Method to fit model by parameters
Also each model requires documentation, class to results and a lot of tests(compare result with R or STATA and statistical tests).


First model was Generalized Poisson model(Pull Request).
I have implemented and tested all components already. There is a small problem with the test on CI, but it will be fixed, because model works fine.

Next model was Zero-Inflated Poisson model with Generic Zero-Inflated model(Pull Request). This model hasn't finished yet.

Let's create a great software!