Skip to main content

Utilities for nonlinear least-squares fits.

Project description

This package facilitates least-squares fitting of noisy data by multi-dimensional, nonlinear functions of arbitrarily many parameters. lsqfit supports Bayesian priors for the fit parameters, with arbitrarily complicated multidimensional Gaussian distributions. A tutorial on fitting is included in the documentation; documentation is in the doc/ subdirectory: see doc/html/index.html or <https://lsqfit.readthedocs.io>.

The fitter uses automatic differentiation to compute gradients of the fit function. This greatly simplifies coding of the fit function since only the function itself need be coded. Coding is also simplified by using dictionaries (instead of arrays) for representing fit data and fit priors.

lsqfit makes heavy use of Python package gvar, which simplifies the analysis of error propagation and the creation of multi-dimensional Gaussian distributions (for fit priors).

This code has been used on a laptop to fit functions of tens-to-thousands of parameters to tens-to-thousands of pieces of data. lsqfit uses the GNU Scientific Library (GSL) and/or scipy to do the fitting, numpy for efficient array arithmetic, and cython to compile efficient code that interfaces between Python and the C-based GSL.

Information on how to install the components is in the INSTALLATION file.

To test the libraries try make tests. Some examples are give in the examples/ subdirectory.

Version numbers: Incompatible changes are signaled by incrementing the major version number, where version numbers have the form major.minor.patch. The minor number signals new features, and the patch number bug fixes.

Created by G. Peter Lepage (Cornell University) 2008
Copyright (c) 2008-2020 G. Peter Lepage
https://zenodo.org/badge/4593457.svg

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

lsqfit-11.6.tar.gz (1.5 MB view details)

Uploaded Source

File details

Details for the file lsqfit-11.6.tar.gz.

File metadata

  • Download URL: lsqfit-11.6.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for lsqfit-11.6.tar.gz
Algorithm Hash digest
SHA256 cf973c5ece153ef15066b1aae25b52518cc9dc17ff11d037973c331e5a845fa2
MD5 0679daa00e890bfd5e368a3f66af8015
BLAKE2b-256 291fd30b80c44956ace236bfcba01c76087672356024407b7a5a3b9533e4ef83

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