org.ddogleg.optimization.wrap
Class QuasiNewtonBFGS_to_UnconstrainedMinimization
- java.lang.Object
-
- org.ddogleg.optimization.wrap.QuasiNewtonBFGS_to_UnconstrainedMinimization
-
- All Implemented Interfaces:
- java.io.Serializable, IterativeOptimization, UnconstrainedMinimization
public class QuasiNewtonBFGS_to_UnconstrainedMinimization extends java.lang.Object implements UnconstrainedMinimization
Wrapper aroundQuasiNewtonBFGSforUnconstrainedMinimization. For a description of what the line parameters mean seeLineSearchMore94.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description QuasiNewtonBFGS_to_UnconstrainedMinimization()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetFunctionValue()Returns the value of the objective function being evaluated at the current parameters value.doublegetLine_ftol()doublegetLine_gtol()doublegetLine_xtol()double[]getParameters()After each iteration this function can be called to get the current best set of parameters.java.lang.StringgetWarning()Provides feed back if something went wrong, but still produced a solution.voidinitialize(double[] initial, double ftol, double gtol)Specify the initial set of parameters from which to start from.booleanisConverged()Indicates if iteration stopped due to convergence or not.booleanisUpdated()True if the parameter(s) being optimized have been updatedbooleaniterate()Updates the search.voidsetFunction(FunctionNtoS function, FunctionNtoN gradient, double minFunctionValue)Specifies the function being optimized.voidsetLine_ftol(double line_ftol)voidsetLine_gtol(double line_gtol)voidsetLine_xtol(double line_xtol)
-
-
-
Constructor Detail
-
QuasiNewtonBFGS_to_UnconstrainedMinimization
public QuasiNewtonBFGS_to_UnconstrainedMinimization()
-
-
Method Detail
-
setFunction
public void setFunction(FunctionNtoS function, FunctionNtoN gradient, double minFunctionValue)
Description copied from interface:UnconstrainedMinimizationSpecifies the function being optimized. A numerical Jacobian will be computed if null is passed in.- Specified by:
setFunctionin interfaceUnconstrainedMinimization- Parameters:
function- Function being optimized.gradient- Partial derivative for each input in the function. If null a numerical gradient will be computed.minFunctionValue- Minimum possible value that 'function' can have. E.g. for least squares problems this value should be set to zero.
-
initialize
public void initialize(double[] initial, double ftol, double gtol)Description copied from interface:UnconstrainedMinimizationSpecify the initial set of parameters from which to start from. Call afterUnconstrainedMinimization.setFunction(org.ddogleg.optimization.functions.FunctionNtoS, org.ddogleg.optimization.functions.FunctionNtoN, double)has been called.- Specified by:
initializein interfaceUnconstrainedMinimization- Parameters:
initial- Initial parameters or guess.ftol- Relative convergence test based on function value. 0 disables test. 0 ≤ ftol<1, Try 1e-12gtol- Absolute convergence test based on gradient. 0 disables test. 0 ≤ gtol. Try 1e-12
-
getParameters
public double[] getParameters()
Description copied from interface:UnconstrainedMinimizationAfter each iteration this function can be called to get the current best set of parameters.- Specified by:
getParametersin interfaceUnconstrainedMinimization
-
iterate
public boolean iterate() throws OptimizationExceptionDescription copied from interface:IterativeOptimizationUpdates the search. If the search has terminated true is returned. After the search has terminated invoke
IterativeOptimization.isConverged()to see if a solution has been converged to or if it stopped for some other reason.NOTE: The optimization parameters might not be modified after iterate() is called. An internal book keeping step might have been done. To see if parameters have changed call
IterativeOptimization.isUpdated().- Specified by:
iteratein interfaceIterativeOptimization- Returns:
- true if it has converged or that no more progress can be made.
- Throws:
OptimizationException
-
isConverged
public boolean isConverged()
Description copied from interface:IterativeOptimizationIndicates if iteration stopped due to convergence or not.- Specified by:
isConvergedin interfaceIterativeOptimization- Returns:
- True if iteration stopped because it converged.
-
getWarning
public java.lang.String getWarning()
Description copied from interface:IterativeOptimizationProvides feed back if something went wrong, but still produced a solution. If there is no message then null is returned. The meaning and type of messages are implementation specific.- Specified by:
getWarningin interfaceIterativeOptimization- Returns:
- Additional info on the computed solution.
-
getFunctionValue
public double getFunctionValue()
Description copied from interface:UnconstrainedMinimizationReturns the value of the objective function being evaluated at the current parameters value. If not supported then an exception is thrown.- Specified by:
getFunctionValuein interfaceUnconstrainedMinimization- Returns:
- Objective function's value.
-
isUpdated
public boolean isUpdated()
Description copied from interface:IterativeOptimizationTrue if the parameter(s) being optimized have been updated- Specified by:
isUpdatedin interfaceIterativeOptimization- Returns:
- True if parameters have been updated
-
getLine_gtol
public double getLine_gtol()
-
setLine_gtol
public void setLine_gtol(double line_gtol)
-
getLine_ftol
public double getLine_ftol()
-
setLine_ftol
public void setLine_ftol(double line_ftol)
-
getLine_xtol
public double getLine_xtol()
-
setLine_xtol
public void setLine_xtol(double line_xtol)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG