Skip to main content

A tool to fit data to many distributions and best one(s)

Project description

https://badge.fury.io/py/fitter.svg https://pypip.in/d/fitter/badge.png https://secure.travis-ci.org/cokelaer/fitter.png https://coveralls.io/repos/cokelaer/fitter/badge.png?branch=master https://landscape.io/github/cokelaer/fitter/master/landscape.png https://badge.waffle.io/cokelaer/fitter.png?label=ready&title=Ready

Compatible with Python 2.7 and 3.3

What is it ?

fitter package provides a simple class to identify the distribution from which a data samples is generated from. It uses 80 distributions from Scipy and allows you to plot the results to check what is the most probable distribution and the best parameters.

Installation

pip install fitter

Usage

First, let us create a data samples with N = 1e5 points from a gamma distribution:

from scipy import stats
data = stats.gamma.rvs(2, loc=1.5, scale=2, size=100000)

Now, without any knowledge about the distribution or its parameter, what is the distribution that fits t he data best ? Scipy has 80 distributions and the Fitter class will scan all of them, call the fit f unction for you, ignoring those that fail or run forever and finally give you a summary of the best dist ributions 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()
http://pythonhosted.org/fitter/_images/index-1.png

See the online documentation for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fitter-1.0.0.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file fitter-1.0.0.tar.gz.

File metadata

  • Download URL: fitter-1.0.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fitter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8b511a28e757d7826d78f50975c8cc65efe83f9f55dbb53677cf9ba93ca95c5c
MD5 dac91ead869b356b9dcda5c7c58242f9
BLAKE2b-256 d5174a310ac166fb5e6a6663db3cedc27321ac3f645998a91f91fc9ddcc7907f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page