|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnr.minimizer.LevenbergMarquardtBroyden
public class LevenbergMarquardtBroyden
Minimizes a function that generates a Vec by nonlinear least squares minimization of the difference between a given Vec of data and the function results. Uses the method of Levenberg-Marquardt (Numerical Recipes section 15.5). Assumes the sigmas (standard deviations) on the data are identically 1. Since the sigmas are implied, the covariance matrix says nothing about the goodness-of-fit, and this class does not return it. Calculates the Jacobian by symmetric finite differencing the first time, then updates it by Broyden's "good method" (Numerical Recipes equation 9.7.17). Converges when the computed sum-of-squares changes by less than epsilon.
Constructor Summary | |
---|---|
LevenbergMarquardtBroyden(Vec data,
VecFunction f)
Create a new instance of LevenbergMarquardtBroyden. |
Method Summary | |
---|---|
double |
getEpsilon()
return the relative accuracy parameter |
double |
minimize(Vec v)
minimizes a function. |
int |
numFuncEvals()
the number of function evaluations it took to converge to the minimum. |
void |
setEpsilon(double epsilon)
set the desired relative accuracy parameter. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LevenbergMarquardtBroyden(Vec data, VecFunction f)
data
- the data to which to minimize the sum of squared
differences.f
- the function that takes a vector of parameters
and outputs a vector of simulated dataMethod Detail |
---|
public double minimize(Vec v)
VecMinimizer
minimize
in interface VecMinimizer
v
- the initial guess for the function. On return, is set
to the local minimum.
public int numFuncEvals()
VecMinimizer
numFuncEvals
in interface VecMinimizer
public void setEpsilon(double epsilon)
VecMinimizer
setEpsilon
in interface VecMinimizer
public double getEpsilon()
VecMinimizer
getEpsilon
in interface VecMinimizer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |