Class QuasiNewtonBFGS
- java.lang.Object
-
- org.ddogleg.optimization.impl.QuasiNewtonBFGS
-
public class QuasiNewtonBFGS extends java.lang.ObjectQuasi-Newton nonlinear optimization using BFGS update on the approximate inverse Hessian with a line search. The function and its gradient is required. If no gradient is available then a numerical gradient will be used. The line search must meet the Wolfe or strong Wolfe condition. This technique is automatically scale invariant and no scale matrix is required. In most situations super-linear convergence can be expected. Based on the description provided in [1].
The inverse Hessian update requires only a rank-2 making it efficient. Stability requires that the line search maintain the Wolfe or strong Wolfe condition or else the inverse Hessian matrix can stop being symmetric positive definite.
[1] Jorge Nocedal, Stephen J. Wright, "Numerical Optimization" 2nd Ed, 2006 Springer
-
-
Constructor Summary
Constructors Constructor and Description QuasiNewtonBFGS(GradientLineFunction function, LineSearch lineSearch, double funcMinValue)Configures the search.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetFx()double[]getParameters()java.lang.StringgetWarning()Returns the warning message, or null if there is nonevoidinitialize(double[] initial)booleanisConverged()True if the line search converged to a solutionbooleanisUpdatedParameters()booleaniterate()Perform one iteration in the optimization.voidsetConvergence(double ftol, double gtol, double lineGTol)Specify convergence tolerancesvoidsetInitialHInv(org.ejml.data.DenseMatrix64F Hinverse)Manually specify the initial inverse hessian approximation.
-
-
-
Constructor Detail
-
QuasiNewtonBFGS
public QuasiNewtonBFGS(GradientLineFunction function, LineSearch lineSearch, double funcMinValue)
Configures the search.- Parameters:
function- Function being optimizedlineSearch- Line search that selects a solution that meets the Wolfe condition.funcMinValue- Minimum possible function value. E.g. 0 for least squares.
-
-
Method Detail
-
setConvergence
public void setConvergence(double ftol, double gtol, double lineGTol)Specify convergence tolerances- Parameters:
ftol- Relative error tolerance for function value 0<=ftol<=1gtol- Absolute convergence based on gradient norm 0<=gtollineGTol- Slope coefficient for wolfe condition used in line search. 0<lineGTol
-
setInitialHInv
public void setInitialHInv(org.ejml.data.DenseMatrix64F Hinverse)
Manually specify the initial inverse hessian approximation.- Parameters:
Hinverse- Initial hessian approximation
-
initialize
public void initialize(double[] initial)
-
getParameters
public double[] getParameters()
-
iterate
public boolean iterate()
Perform one iteration in the optimization.- Returns:
- true if the optimization has stopped.
-
isConverged
public boolean isConverged()
True if the line search converged to a solution
-
getWarning
public java.lang.String getWarning()
Returns the warning message, or null if there is none
-
getFx
public double getFx()
-
isUpdatedParameters
public boolean isUpdatedParameters()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG