org.ddogleg.optimization.wrap
Class LevenbergDampened_to_UnconstrainedLeastSquares
- java.lang.Object
-
- org.ddogleg.optimization.wrap.LevenbergDampened_to_UnconstrainedLeastSquares
-
- All Implemented Interfaces:
- java.io.Serializable, IterativeOptimization, UnconstrainedLeastSquares
public class LevenbergDampened_to_UnconstrainedLeastSquares extends java.lang.Object implements UnconstrainedLeastSquares
Wrapper aroundLevenbergMarquardtDampenedforUnconstrainedLeastSquares- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description LevenbergDampened_to_UnconstrainedLeastSquares(LevenbergDenseBase alg)
-
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.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(FunctionNtoM function, FunctionNtoMxN jacobian)Specifies a set of functions and their Jacobian.
-
-
-
Constructor Detail
-
LevenbergDampened_to_UnconstrainedLeastSquares
public LevenbergDampened_to_UnconstrainedLeastSquares(LevenbergDenseBase alg)
-
-
Method Detail
-
setFunction
public void setFunction(FunctionNtoM function, FunctionNtoMxN jacobian)
Description copied from interface:UnconstrainedLeastSquaresSpecifies a set of functions and their Jacobian. See class description for documentation on output data format.- Specified by:
setFunctionin interfaceUnconstrainedLeastSquares- Parameters:
function- Computes the output of M functions fi(x) which take in N fit parameters as input.jacobian- Computes the Jacobian of the M functions. If null a numerical Jacobian will be used.
-
initialize
public void initialize(double[] initial, double ftol, double gtol)Description copied from interface:UnconstrainedLeastSquaresSpecify the initial set of parameters from which to start from. Call afterUnconstrainedLeastSquares.setFunction(org.ddogleg.optimization.functions.FunctionNtoM, org.ddogleg.optimization.functions.FunctionNtoMxN)has been called.- Specified by:
initializein interfaceUnconstrainedLeastSquares- Parameters:
initial- Initial parameters or guess with N elements..ftol- Relative threshold for change in function value between iterations. 0 ≤ ftol ≤ 1. Try 1e-12gtol- Absolute threshold for convergence based on the gradient's norm. 0 disables test. 0 ≤ gtol. Try 1e-12
-
getParameters
public double[] getParameters()
Description copied from interface:UnconstrainedLeastSquaresAfter each iteration this function can be called to get the current best set of parameters.- Specified by:
getParametersin interfaceUnconstrainedLeastSquares
-
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:UnconstrainedLeastSquaresReturns the value of the objective function being evaluated at the current parameters value. If not supported then an exception is thrown.- Specified by:
getFunctionValuein interfaceUnconstrainedLeastSquares- 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
-
-
DataMelt 3.0 © DataMelt by jWork.ORG