Class QuasiNewtonBFGS
Quasi-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
-
Method Summary
Modifier and TypeMethodDescriptiondouble
double
getFx()
double[]
void
initialize
(double[] initial) boolean
True if the line search converged to a solutionboolean
boolean
iterate()
Perform one iteration in the optimization.void
setConvergence
(double ftol, double gtol) Specify convergence tolerancesvoid
setFunction
(GradientLineFunction function, double funcMinValue) Specify the function being optimizedvoid
setInitialHInv
(DMatrixRMaj Hinverse) Manually specify the initial inverse hessian approximation.void
setVerbose
(@Nullable PrintStream out, int level)
-
Constructor Details
-
QuasiNewtonBFGS
Configures the search.- Parameters:
lineSearch
- Line search that selects a solution that meets the Wolfe condition.
-
-
Method Details
-
setFunction
Specify the function being optimized- Parameters:
function
- Function to optimizefuncMinValue
- Minimum possible function value. E.g. 0 for least squares.
-
setConvergence
public void setConvergence(double ftol, double gtol) Specify convergence tolerances- Parameters:
ftol
- Relative error tolerance for function value 0<=
ftol<=
1gtol
- Absolute convergence based on gradient norm 0<=
gtol
-
setInitialHInv
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 -
getFx
public double getFx() -
isUpdatedParameters
public boolean isUpdatedParameters() -
setVerbose
-
getLineSearch
-
getFuncMinValue
public double getFuncMinValue()
-