java.lang.Object
imagingbook.common.math.nonlinear.NonlinearLeastSquares
This class defines static methods for simplified access to nonlinear least-squares solvers in Apache Commons Math, hiding much of the available configuration options. If other than default settings are needed, the original (Apache Commons Math) API should be used. See the Appendix C of [1] for additional details and examples.
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int
static int
static double
-
Method Summary
Modifier and TypeMethodDescriptionstatic RealVector
solveGaussNewton
(MultivariateVectorFunction V, MultivariateMatrixFunction J, RealVector z, RealVector p0) Solves the nonlinear least-squares problem defined by the arguments using Gauss-Newton optimization.static RealVector
solveLevenvergMarquardt
(MultivariateVectorFunction V, MultivariateMatrixFunction J, RealVector z, RealVector p0) Solves the nonlinear least-squares problem defined by the arguments using Levenberg-Marquardt optimization.static RealVector
Solves the nonlinear least-squares problem defined by the arguments.static RealVector
-
Field Details
-
MaxEvaluations
-
MaxIterations
-
Tolerance
-
-
Method Details
-
solveNLS
public static RealVector solveNLS(MultivariateVectorFunction V, MultivariateMatrixFunction J, RealVector z, RealVector p0) Solves the nonlinear least-squares problem defined by the arguments. Delegates to the Levenberg-Marquardt method.- Parameters:
V
- the "value" function, V(p) must return a vector for the current parameters pJ
- the "Jacobian" function, J(p) must return a matrix for the current parameters pz
- the vector of observed ("target") valuesp0
- initial parameter vector- Returns:
- the vector of optimal parameters
-
solveLevenvergMarquardt
public static RealVector solveLevenvergMarquardt(MultivariateVectorFunction V, MultivariateMatrixFunction J, RealVector z, RealVector p0) Solves the nonlinear least-squares problem defined by the arguments using Levenberg-Marquardt optimization.- Parameters:
V
- the "value" function, V(p) must return a vector for the current parameters pJ
- the "Jacobian" function, J(p) must return a matrix for the current parameters pz
- the vector of observed ("target") valuesp0
- initial parameter vector- Returns:
- the vector of optimal parameters
-
solveGaussNewton
public static RealVector solveGaussNewton(MultivariateVectorFunction V, MultivariateMatrixFunction J, RealVector z, RealVector p0) Solves the nonlinear least-squares problem defined by the arguments using Gauss-Newton optimization.- Parameters:
V
- the "value" function, V(p) must return a vector for the current parameters pJ
- the "Jacobian" function, J(p) must return a matrix for the current parameters pz
- the vector of observed ("target") valuesp0
- initial parameter vector- Returns:
- the vector of optimal parameters
-
solveNLS2
public static RealVector solveNLS2(MultivariateVectorFunction V, MultivariateMatrixFunction J, RealVector z, RealVector p0)
-