Giter Site home page Giter Site logo

levenberg-marquardt's Introduction

levenberg-marquardt

Discord Crates.io MIT/Apache docs.rs LoC ci

Solver for nonlinear least squares problems

The implementation is a port of the classic MINPACK implementation of the Levenberg-Marquardt (LM) algorithm. This version of the algorithm is sometimes referred to as exact LM.

All current unit tests indicate that we achieved identical output (on a floating-point level) to the MINPACK implementation, especially for rank deficient unstable problems. This was mainly useful for testing. The Fortran algorithm was extended with NaN and inf handling, similar to what lmfit does.

The crate offers a feature called minpack-compat which sets floating-point constants to the ones used by MINPACK and removes the termination criterion of "zero residuals". This is necessary for identical output to MINPACK but generally not recommended.

Usage

See the docs for detailed information.

impl LeastSquaresProblem<f64> for Problem {
    // define this trait for the problem you want to solve
}
let problem = Problem::new(initial_params);
let (problem, report) = LevenbergMarquardt::new().minimize(problem);
assert!(report.termination.was_successful());

References

Software:

  • The MINPACK Fortran implementation.
  • A C version/update, lmfit.
  • A Python implementation in pwkit.

One original reference for the algorithm seems to be

Moré J.J. (1978) The Levenberg-Marquardt algorithm: Implementation and theory. In: Watson G.A. (eds) Numerical Analysis. Lecture Notes in Mathematics, vol 630. Springer, Berlin, Heidelberg.

by one of the authors of MINPACK.

The algorithm is also described in the form as implemented by this crate in the book "Numerical Optimization" by Nocedal and Wright, chapters 4 and 10.

levenberg-marquardt's People

Contributors

vadixidav avatar jannschu avatar geo-ant avatar mpizenberg avatar xd009642 avatar rostyq avatar tversteeg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.