Giter Site home page Giter Site logo

Comments (5)

erdogant avatar erdogant commented on May 27, 2024

Have you seen this issue #4 about integer values? It sounds similar to yours.
Let me know whether this helps.

from distfit.

ogreyesp avatar ogreyesp commented on May 27, 2024

Hi,

Thank you for your response. Yes, I have previously seen this answer... However, I suppose that when I will subsequently try to sample some random numbers from the best fitted distribution, the random numbers will be not exactly integers, but floats, isn´t it?

Following with your example, if we do

best_distr["distr"].rvs(*best_distr["params"], size=10)

the result is:

array([42.43419208, 43.9193906 , 39.83836361, 46.84268631, 6.40314481,
6.14620859, 39.51184439, 8.06064685, 5.75366875, 27.2441456 ])

The only thing that I can do right now is to round these numbers and convert it to integers. However, certainly the distribution is not a discrete one, it is still a continuos one.

Have you planned to extend distfit library to include the discrete distributions available in scipy.stats?

from distfit.

erdogant avatar erdogant commented on May 27, 2024

Good point. Im going to look into this.

from distfit.

wgmueller1 avatar wgmueller1 commented on May 27, 2024

The R package fitdistrplus has an option where a user can specify that the distribution is discrete. I believe they support binomial, poisson, and negative binomial. If you are planning on implementing discrete distributions it might nice to include a discrete option in the fit function or the instantiation of the distfit object.

from distfit.

erdogant avatar erdogant commented on May 27, 2024

I worked on the implementation of discrete fitting using the binomial distribution. This is now possible in the latest version:

# Update to latest version
pip install -U distfit
import distfit
print(distfit.__version__)

This should be >= 1.2.7

Examples for discrete fitting can be found in the readme, sphinx pages and colab notebook:
https://colab.research.google.com/github/erdogant/distfit/blob/master/notebooks/distfit.ipynb
https://erdogant.github.io/distfit/pages/html/Discrete.html

from distfit.

Related Issues (20)

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.