Skip to main content

Regularised least squares objective function solver

Project description


RLS is available on PyPI, and can be installed via

pip install RLS-OF

This package computes model parameters which minimise the error between measured and modelled data, where the sensitivity to model parameters is given (the Jacobian). This package computes the minimum of a regularised least squares objective function using a selection of trust region algorithms from the TRA package. Tikhonov regularisation is used, where the regularisation matrix can be a finite difference operator or the identity. Further, the NL2SOL algorithm can be chosen such that the Hessian is better approximated for large residual problems.

Example Call

import RLS as regularised_least_squares
RLS_class = regularised_least_squares.RLS(measurement, initial_guess,
                                                       forward_compute, lower_constraint=0, upper_constraint=140e3, search_direction='Levenberg-Marquardt')

minimum = self.RLS_class.compute_minimum()

Suppose we make a series of complex inductance measurements and we want to find the best fit with a model of a problem by tuning various material electrical conductivity variables. First, the real and imaginary parts of the data can be concatenated to give, effectively, twice the number of measurement points. Applying the RLS algorithm the fitted inductance curves:


The predicted model paramters:



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


[1] Hansen, P. C. (1997). Rank-deficient and Discrete Ill-posed Problems: Numerical Aspects of Linear Inversion.

[2] Nocedal, J. and Wright, S. (2006). Numerical Optimization.

[3] Conn, A. and Gould, N. and Toint, P. (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

RLS - OF-1.11.tar.gz (3.8 kB view hashes)

Uploaded source

Built Distribution

RLS_OF-1.11-py3-none-any.whl (5.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page