lmfit - Levenberg-Marquardt least-squares minimization
lmfit is a C library for Levenberg-Marquardt least-squares minimization and curve fitting. It is mature code, based on decades-old algorithms from the FORTRAN library MINPACK.
For fitting a data set {(x_i,y_i)|i=0,1,..} by a parametric curve f(x,t), see lmcurve(3).
For fitting a data set {(x_i,y_i+-dy_i)|i=0,1,..} by a parametric curve f(x,t), with parameter uncertainties and covariance matrix, see lmcurve3(3).
For generic minimization of the Eucledian norm of parametric vector, with parameter uncertainties and covariance matrix, see lmmin3(3).
For the simpler API without error estimates, see lmmin(3).
Functions lmcurve2(3) and lmmin2(3) are obsolescent: phased out in favor of lmcurve3(3) and lmmin3(3), because the conventions of their error estimates are unclear; they remain available through lmfit 12, and their man pages explain what they compute.
For an example how to use lmmin, see the source files lmcurve.h and lmcurve.c. Do not patch these files; copy and modify them to create your own, differently named version of lmcurve_data_struct, lmcurve_evaluate, and lmcurve.
For an example how to use lmmin3 for weighted data, see the source files lmcurve3.h and lmcurve3.c. Do not patch these files; copy and modify them to create your own, differently named version of lmcurve3_data_struct, lmcurve3_evaluate, and lmcurve3.
Copyright (C): 1980-1999 University of Chicago 2004-2026 Joachim Wuttke, Forschungszentrum Juelich GmbH
Software: FreeBSD License
Documentation: Creative Commons Attribution Share Alike
Homepage: https://jugit.fz-juelich.de/mlz/lmfit
Please send bug reports and suggestions to the author <j.wuttke@fz-juelich.de>.