Skip to main content

Levenberg-Marqaurdt for non-linear optimisation.

Project description

This package provides trust region algorithms (TRA) for finding the minimum of some function. At the minute it contains only Levenberg-Marquart, but will be expanded to include NL2SOL and Powell's dogleg.

Levenberg-Marquardt

Example

An example is included within the package, simply call:

Import TRA as TRA
example_problem = TRA.example()
minimum = example_problem.find_minimum()

image

This is a simple example, but shows how to use the Levenberg_Marquart class.

Function calls and arguments

There are a number of default values within the Levenberg_Marqaurdt class, including constraints on the solution, the number of iterations amd the damping parameter corresponding to the trust region. Three functions are required when instantiating a class object, one for computing the gradient, one for the Hessian and one for the mapping of the input to ouput (forward model).

:
def forward_model(x)
    :
    return f(x)
def compute_gradient(x):
    :
return grad

def compute_hessian(x):
    :
return hessian

initial_prediction = x0

LM_object = TRA.Levenberg_Marquart(initial_prediction, compute_hessian, compute_gradient,
                                                  forward_model, d_param=1e-50,
                                                  lower_constraint=-np.inf,
                                                  upper_constraint=np.inf,
                                                  num_iterations=5)



Theory

For the theory behind the code see [1] and [2].

References

[1] Jorge Nocedal and Stephen J. Wright (2006). Numerical Optimization.

[2] Andrew R. Conn, Nicholas I. M. Gould, and P.L. Toint (2000). Trust Region Methods.

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

TRA-1.7.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TRA-1.7-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file TRA-1.7.tar.gz.

File metadata

  • Download URL: TRA-1.7.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.4

File hashes

Hashes for TRA-1.7.tar.gz
Algorithm Hash digest
SHA256 a90500355b3d53b5c7a0c3eaa04556c86cfd4a7764286fb0aeab3bcec3a7b8b4
MD5 6375161e3a3d95a3902c5eeda66d86b2
BLAKE2b-256 be01825e21f2ccde68ee0c155a64960ab7791bf9e6db19f10514e8b1fa084217

See more details on using hashes here.

File details

Details for the file TRA-1.7-py3-none-any.whl.

File metadata

  • Download URL: TRA-1.7-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.4

File hashes

Hashes for TRA-1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6d6dd06b683de5d6f18e0a5252cadd8b930689d1b1d528958febe41e4248b740
MD5 081a17727974181583a4ed515d4598be
BLAKE2b-256 ac6663f9b8727f5b7450daaf0e6bc3a065c65928884e66d826d213ebdaa28d1d

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