FITTER documentation
Compatible with Python 3.9, 3.10, 3.11, 3.12, 3.13
What is it ?
The fitter package is a Python library used for fitting probability distributions to data. It provides a straightforward and and intuitive interface to estimate parameters for various types of distributions, both continuous and discrete. Using fitter, you can easily fit a range of distributions to your data and compare their fit, aiding in the selection of the most suitable distribution. The package is designed to be user-friendly and requires minimal setup, making it a useful tool for data scientists and statisticians working with probability distributions.
Installation
pip install fitter
fitter is also available on conda (bioconda channel):
conda install fitter
Usage
standalone
A standalone application (very simple) is also provided and works with input CSV files:
fitter fitdist data.csv --column-number 1 --distributions gamma,normal
It creates a file called fitter.png and a log fitter.log
From Python shell
First, let us create a data samples with N = 10,000 points from a gamma distribution:
from scipy import stats data = stats.gamma.rvs(2, loc=1.5, scale=2, size=10000)
Now, without any knowledge about the distribution or its parameter, what is the distribution that fits the data best ? Scipy has 80 distributions and the Fitter class will scan all of them, call the fit function for you, ignoring those that fail or run forever and finally give you a summary of the best distributions in the sense of sum of the square errors. The best is to give an example:
from fitter import Fitter f = Fitter(data) f.fit() # may take some time since by default, all distributions are tried # but you call manually provide a smaller set of distributions f.summary()
See the online documentation for details.
Contributors
Setting up and maintaining Fitter has been possible thanks to users and contributors. Thanks to all:
Changelog
Version |
Description |
|---|---|
1.8.1 |
|
1.8.0 |
|
1.7.1 |
|
1.7.0 |
|
1.6.0 |
|
1.5.2 |
|
1.5.1 |
|
1.5.0 |
|
1.4.1 |
|
1.4.0 |
|
1.3.0 |
|
1.2.3 |
|
1.2.2 |
was not released |
1.2.1 |
adding new class called histfit (see documentation) |
1.2 |
|
1.1 |
|
1.0.9 |
|
1.0.6 |
|
1.0.5 |
|
1.0.2 |
add manifest to fix missing source in the pypi repository. |
Metadata
Release files for fitter 1.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fitter-1.8.1.tar.gz | 31.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fitter-1.8.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 62.1 kB
Release files / fitter-1.8.1.tar.gz
| Download URL | fitter-1.8.1.tar.gz |
|---|---|
| Size | 31.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dde80cc2a02b863935e3da80c193c151ac7d9e20751edadd251c233a3e0bd35d
|
|
BLAKE2b-256 checksum How to use checksums |
2e81564139623fcec2fc962ca8d319de88536ec8060b9f6f3a92d7e5631b366c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.11.15 Linux/6.14.5-100.fc40.x86_64
|
Release files / fitter-1.8.1-py3-none-any.whl
| Download URL | fitter-1.8.1-py3-none-any.whl |
|---|---|
| Size | 31.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c4e311d36a60a0fcafced666f3eb2923e5590912e19c8b9c697e0b86812fec2
|
|
BLAKE2b-256 checksum How to use checksums |
569b106262e61d40308b4ad7900a779eafe865263a6089a265b357f61324190b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.11.15 Linux/6.14.5-100.fc40.x86_64
|