All Projects → lmfit → Lmfit Py

lmfit / Lmfit Py

Licence: other
Non-Linear Least Squares Minimization, with flexible Parameter settings, based on scipy.optimize, and with many additional classes and methods for curve fitting.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Lmfit Py

jun
JUN - python pandas, plotly, seaborn support & dataframes manipulation over erlang
Stars: ✭ 21 (-96.63%)
Mutual labels:  scipy
Gcc termux
Gcc for termux with fortran scipy etc... Use apt for newest updates instructions in README.txt
Stars: ✭ 276 (-55.77%)
Mutual labels:  scipy
Dsp Theory
Theory of digital signal processing (DSP): signals, filtration (IIR, FIR, CIC, MAF), transforms (FFT, DFT, Hilbert, Z-transform) etc.
Stars: ✭ 437 (-29.97%)
Mutual labels:  scipy
SciPyDiffEq.jl
Wrappers for the SciPy differential equation solvers for the SciML Scientific Machine Learning organization
Stars: ✭ 19 (-96.96%)
Mutual labels:  scipy
Ahkab
a SPICE-like electronic circuit simulator written in Python
Stars: ✭ 273 (-56.25%)
Mutual labels:  scipy
Docker Django
A complete docker package for deploying django which is easy to understand and deploy anywhere.
Stars: ✭ 378 (-39.42%)
Mutual labels:  scipy
sparse dot
Python wrapper for Intel Math Kernel Library (MKL) matrix multiplication
Stars: ✭ 38 (-93.91%)
Mutual labels:  scipy
Cupy
NumPy & SciPy for GPU
Stars: ✭ 5,625 (+801.44%)
Mutual labels:  scipy
Audio Spectrum Analyzer In Python
A series of Jupyter notebooks and python files which stream audio from a microphone using pyaudio, then processes it.
Stars: ✭ 273 (-56.25%)
Mutual labels:  scipy
Matchering
🎚️ Open Source Audio Matching and Mastering
Stars: ✭ 398 (-36.22%)
Mutual labels:  scipy
Python-Matematica
Explorando aspectos fundamentais da matemática com Python e Jupyter
Stars: ✭ 41 (-93.43%)
Mutual labels:  scipy
Verde
Processing and interpolating spatial data with a twist of machine learning
Stars: ✭ 260 (-58.33%)
Mutual labels:  scipy
Stats Maths With Python
General statistics, mathematical programming, and numerical/scientific computing scripts and notebooks in Python
Stars: ✭ 381 (-38.94%)
Mutual labels:  scipy
GUI Blob Tracker
Python GUI Multiple Blob Tracker
Stars: ✭ 24 (-96.15%)
Mutual labels:  scipy
Data Science Ipython Notebooks
Data science Python notebooks: Deep learning (TensorFlow, Theano, Caffe, Keras), scikit-learn, Kaggle, big data (Spark, Hadoop MapReduce, HDFS), matplotlib, pandas, NumPy, SciPy, Python essentials, AWS, and various command lines.
Stars: ✭ 22,048 (+3433.33%)
Mutual labels:  scipy
sentences-similarity-cluster
Calculate similarity of sentences & Cluster the result.
Stars: ✭ 14 (-97.76%)
Mutual labels:  scipy
Scipy Lecture Notes Zh Cn
中文版scipy-lecture-notes. 网站下线, 以离线HTML的形式继续更新, 见release.
Stars: ✭ 362 (-41.99%)
Mutual labels:  scipy
Py Findpeaks
Overview of the peaks dectection algorithms available in Python
Stars: ✭ 566 (-9.29%)
Mutual labels:  scipy
Librosa
Python library for audio and music analysis
Stars: ✭ 4,901 (+685.42%)
Mutual labels:  scipy
Workshopscipy
A workshop for scientific computing in Python. ( December 2017 )
Stars: ✭ 391 (-37.34%)
Mutual labels:  scipy

LMfit-py

.. image:: https://dev.azure.com/lmfit/lmfit-py/_apis/build/status/lmfit.lmfit-py?branchName=master :target: https://dev.azure.com/lmfit/lmfit-py/_build/latest?definitionId=1&branchName=master

.. image:: https://codecov.io/gh/lmfit/lmfit-py/branch/master/graph/badge.svg :target: https://codecov.io/gh/lmfit/lmfit-py

.. image:: https://img.shields.io/pypi/v/lmfit.svg :target: https://pypi.org/project/lmfit

.. image:: https://img.shields.io/pypi/dm/lmfit.svg :target: https://pypi.org/project/lmfit

.. image:: https://img.shields.io/badge/docs-read-brightgreen :target: https://lmfit.github.io/lmfit-py/

.. image:: https://zenodo.org/badge/4185/lmfit/lmfit-py.svg :target: https://zenodo.org/badge/latestdoi/4185/lmfit/lmfit-py

.. _LMfit mailing list: https://groups.google.com/group/lmfit-py

Overview

LMfit-py provides a Least-Squares Minimization routine and class with a simple, flexible approach to parameterizing a model for fitting to data.

LMfit is a pure Python package, and so easy to install from source or with pip install lmfit.

For questions, comments, and suggestions, please use the LMfit mailing list. Using the bug tracking software in GitHub Issues is encouraged for known problems and bug reports. Please read Contributing.md <.github/CONTRIBUTING.md> before creating an Issue.

Parameters and Fitting

LMfit-py provides a Least-Squares Minimization routine and class with a simple, flexible approach to parameterizing a model for fitting to data. Named Parameters can be held fixed or freely adjusted in the fit, or held between lower and upper bounds. In addition, parameters can be constrained as a simple mathematical expression of other Parameters.

To do this, the programmer defines a Parameters object, an enhanced dictionary, containing named parameters::

fit_params = Parameters()
fit_params['amp'] = Parameter(value=1.2, min=0.1, max=1000)
fit_params['cen'] = Parameter(value=40.0, vary=False)
fit_params['wid'] = Parameter(value=4, min=0)

or using the equivalent::

fit_params = Parameters()
fit_params.add('amp', value=1.2, min=0.1, max=1000)
fit_params.add('cen', value=40.0, vary=False)
fit_params.add('wid', value=4, min=0)

The programmer will also write a function to be minimized (in the least-squares sense) with its first argument being this Parameters object, and additional positional and keyword arguments as desired::

def myfunc(params, x, data, someflag=True):
    amp = params['amp'].value
    cen = params['cen'].value
    wid = params['wid'].value
    ...
    return residual_array

For each call of this function, the values for the params may have changed, subject to the bounds and constraint settings for each Parameter. The function should return the residual (i.e., data-model) array to be minimized.

The advantage here is that the function to be minimized does not have to be changed if different bounds or constraints are placed on the fitting Parameters. The fitting model (as described in myfunc) is instead written in terms of physical parameters of the system, and remains remains independent of what is actually varied in the fit. In addition, which parameters are adjusted and which are fixed happens at run-time, so that changing what is varied and what constraints are placed on the parameters can easily be modified by the user in real-time data analysis.

To perform the fit, the user calls::

result = minimize(myfunc, fit_params, args=(x, data), kws={'someflag':True}, ....)

After the fit, a MinimizerResult class is returned that holds the results the fit (e.g., fitting statistics and optimized parameters). The dictionary result.params contains the best-fit values, estimated standard deviations, and correlations with other variables in the fit.

By default, the underlying fit algorithm is the Levenberg-Marquart algorithm with numerically-calculated derivatives from MINPACK's lmdif function, as used by scipy.optimize.leastsq. Most other solvers that are present in scipy (e.g., Nelder-Mead, differential_evolution, basinhopping, etctera) are also supported.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].