Comments (5)
Have you seen this issue #4 about integer values? It sounds similar to yours.
Let me know whether this helps.
from distfit.
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.
Good point. Im going to look into this.
from distfit.
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.
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)
- Can I use the best distribution as the true distribution of my data? HOT 3
- KS-test in fitdist HOT 13
- Add K distribution HOT 4
- Robustness of selected data models HOT 3
- pip install bnlearn? HOT 1
- Save best parameters HOT 2
- T Distribution Weirdness HOT 2
- Plots are not generated HOT 2
- A code snippet for `plotting` the best fit and the original data HOT 3
- New User Plot Question HOT 5
- new feature request - automatically fit multiple variables HOT 2
- plot_summary throws error HOT 2
- extend __init__.py descriptions HOT 3
- Help needed to interpret loc and scale HOT 2
- Boostrapping bug - The data contains non-finite values HOT 2
- Bug(?): lognorm distribution with negative loc parameter HOT 2
- Feature request: parallel execution when fitting multiple distributions HOT 3
- Quantile Bootstrap to avoid computationally expensive simple Bootstrap HOT 1
- plot freeze HOT 8
- Support Gaussian Mixture distribution fitting (2GMM, 3GMM..) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from distfit.