Skip to main content

Symbolic Fitting; fitting as it should be.

Project description

Existing fitting modules are not very pythonic in their API and can be difficult for humans to use. This project aims to marry the power of scipy.optimize with the readability of SymPy to create a highly readable and easy to use fitting package which works for projects of any scale.

symfit makes it extremely easy to provide guesses for your parameters and to bound them to a certain range:

a = Parameter(1.0, min=0.0, max=5.0)

To define models to fit to:

x = Variable()
A = Parameter()
sig = Parameter(1.0, min=0.0, max=5.0)
x0 = Parameter(1.0, min=0.0)
# Gaussian distrubution
model = A * exp(-(x - x0)**2/(2 * sig**2))

To execute the fit:

fit = Fit(model, xdata, ydata)
fit_result = fit.execute()

And finally, to evaluate the model using the best fit parameters:

y = model(x=xdata, **fit_result.params)
Gaussian Data

For more examples, check out the docs at http://symfit.readthedocs.org/

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

symfit-0.2.5.zip (19.5 kB view details)

Uploaded Source

File details

Details for the file symfit-0.2.5.zip.

File metadata

  • Download URL: symfit-0.2.5.zip
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for symfit-0.2.5.zip
Algorithm Hash digest
SHA256 75922784dc930bc41649fea0f5d6dfb4487298a721ac10f2b96e8c06e7fbf92b
MD5 f34fde55da73d146c922f0a1de4ff295
BLAKE2b-256 0abc6942164e13c7028675dca24afbd328eb51a7678a49663e662125a47b1e95

See more details on using hashes here.

Supported by

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