public class LevenbergMarquardtSolver extends Object
It was adapted and stripped from jplewis (www.idiom.com/~zilla) and released under the GPL. There are various small tweaks for robustness and speed, mainly a first step to derive a crude estimate, based on maximum-likelihood analytic formulae.
Constructor and Description |
---|
LevenbergMarquardtSolver() |
Modifier and Type | Method and Description |
---|---|
static double |
chiSquared(double[][] x,
double[] a,
double[] y,
FitFunction f)
Calculate the current sum-squared-error
|
static int |
solve(double[][] x,
double[] a,
double[] y,
FitFunction f,
double lambda,
double termepsilon,
int maxiter)
Minimize E = sum {(y[k] - f(x[k],a)) }^2
Note that function implements the value and gradient of f(x,a),
NOT the value and gradient of E with respect to a!
|
public static final double chiSquared(double[][] x, double[] a, double[] y, FitFunction f)
public static final int solve(double[][] x, double[] a, double[] y, FitFunction f, double lambda, double termepsilon, int maxiter) throws Exception
x
- array of domain points, each may be multidimensionaly
- corresponding array of valuesa
- the parameters/state of the modellambda
- blend between steepest descent (lambda high) and
jump to bottom of quadratic (lambda zero). Start with 0.001.termepsilon
- termination accuracy (0.01)maxiter
- stop and return after this many iterations if not doneException
Copyright © 2015–2021 Fiji. All rights reserved.