Class LMOptimiser
-
- All Implemented Interfaces:
Serializable,Descriptive,Reflexive
public class LMOptimiser extends GradientBasedOptimiser
Given an objective function equal to the sum of squared residuals, iteratively approaches the minimum of this function by applying the Levenberg-Marquardt formulas.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_FAILED_ATTEMPTSUp to 5 failed attempts are allowed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancompatibleWith(OptimiserStatistic os)The Levenberg-Marquardt optimiser will only accept ordinary least-squares as its objective function.NumericPropertygetDampingRatio()static LMOptimisergetInstance()This class uses a singleton pattern, meaning there is only instance of this class.GradientGuidedPathinitState(GeneralTask t)Creates a newPathsuitable for thisPathSolverbooleaniteration(GeneralTask task)This method sets out the basic algorithm for estimating the minimum of the target function, which is defined as the sum of squared residuals (SSR), or the deviations of the model solution (aDifferenceSchemeused to solve theProblemfor thistask) from the empirical values (theExperimentalData).RectangularMatrixjacobian(GeneralTask task)Calculates the Jacobian of the model function given as a discrete set of time-signal values.Set<NumericPropertyKeyword>listedKeywords()The types of the listed parameters for this class include:GRADIENT_RESOLUTION, ERROR_TOLERANCE, ITERATION_LIMIT.voidprepare(GeneralTask task)Calculates the Jacobian, if needed, evaluates the gradient and the Hessian matrix.voidset(NumericPropertyKeyword type, NumericProperty property)The accepted types are:GRADIENT_RESOLUTION, ERROR_TOLERANCE, ITERATION_LIMIT.voidsetDampingRatio(NumericProperty dampingRatio)StringtoString()-
Methods inherited from class pulse.search.direction.GradientBasedOptimiser
dx, getGradientResolution, getGradientStep, gradient, reset, setGradientResolution
-
Methods inherited from class pulse.search.direction.PathOptimiser
genericProperties, getErrorTolerance, getMaxIterations, getSolver, ignoreSiblings, setErrorTolerance, setInstance, setMaxIterations, setSolver, update
-
Methods inherited from class pulse.util.PropertyHolder
addListener, areDetailsHidden, data, describe, firePropertyChanged, getDescriptor, getListeners, getPrefix, initListeners, isListedNumericType, isListedParameter, listedTypes, numericData, parameterListChanged, removeListeners, setPrefix, updateProperties, updateProperty
-
Methods inherited from class pulse.util.Accessible
accessibleChildren, genericProperty, numericProperties, numericProperty, property, update
-
Methods inherited from class pulse.util.UpwardsNavigable
addHierarchyListener, getHierarchyListeners, getParent, identify, removeHierarchyListener, removeHierarchyListeners, setParent, specificAncestor, tellParent
-
-
-
-
Field Detail
-
MAX_FAILED_ATTEMPTS
public static final int MAX_FAILED_ATTEMPTS
Up to 5 failed attempts are allowed.- See Also:
- Constant Field Values
-
-
Method Detail
-
iteration
public boolean iteration(GeneralTask task) throws SolverException
Description copied from class:PathOptimiserThis method sets out the basic algorithm for estimating the minimum of the target function, which is defined as the sum of squared residuals (SSR), or the deviations of the model solution (a
DifferenceSchemeused to solve theProblemfor thistask) from the empirical values (theExperimentalData). The algorithm will go through the following steps: (1) find the direction, which points to the minimum, using the concretedirectionmethod; (2) estimate the magnitude of the step to reach the minimum using theLinearSolver; (3) assign a new set of parameters to theSearchTask; (4) calculate the new SSR value.- Specified by:
iterationin classPathOptimiser- Parameters:
task- aSearchTaskthat needs to be driven to a minimum of SSR.- Returns:
- the SSR value with the newly found parameters.
- Throws:
SolverException- See Also:
direction(Path),LinearOptimiser
-
prepare
public void prepare(GeneralTask task) throws SolverException
Calculates the Jacobian, if needed, evaluates the gradient and the Hessian matrix.- Specified by:
preparein classPathOptimiser- Parameters:
task- theSearchTaskundergoing optimisation- Throws:
SolverException
-
jacobian
public RectangularMatrix jacobian(GeneralTask task) throws SolverException
Calculates the Jacobian of the model function given as a discrete set of time-signal values. The elements of the Jacobian are calculated using central differences from two residual vectors evaluated by shifting the search vector slightly to the right or left of each search parameter.
This is also equivalent to calculating the difference of the model values when performing the shift, when taking the model values at the time points of the reference dataset. Because of a different discretisation of the model, it is easier to substitute these with the residuals, which had already been interpolated at the reference time values.
- Parameters:
task- the task being optimised- Returns:
- the jacobian matrix
- Throws:
SolverException
-
initState
public GradientGuidedPath initState(GeneralTask t)
Description copied from class:PathOptimiserCreates a newPathsuitable for thisPathSolver- Specified by:
initStatein classPathOptimiser- Parameters:
t- the task, the optimisation path of which will be tracked- Returns:
- a
Pathinstance
-
listedKeywords
public Set<NumericPropertyKeyword> listedKeywords()
Description copied from class:GradientBasedOptimiserThe types of the listed parameters for this class include:
GRADIENT_RESOLUTION, ERROR_TOLERANCE, ITERATION_LIMIT. Also, all the flags in this class are treated as separate listed parameters.- Overrides:
listedKeywordsin classGradientBasedOptimiser- Returns:
- a set of
NumericPropertyKeywordinstances, which have been explicitly marked as a listed parameter for thisPropertyHolder. - See Also:
NumericPropertyKeyword
-
getInstance
public static LMOptimiser getInstance()
This class uses a singleton pattern, meaning there is only instance of this class.- Returns:
- the single (static) instance of this class
-
toString
public String toString()
- Overrides:
toStringin classPathOptimiser
-
compatibleWith
public boolean compatibleWith(OptimiserStatistic os)
The Levenberg-Marquardt optimiser will only accept ordinary least-squares as its objective function. Therefore,osshould be an instance ofSumOfSquares.- Overrides:
compatibleWithin classPathOptimiser- Parameters:
os- a selected optimiser metric- Returns:
trueif returnsSumOfSquares.class,falseotherwise
-
getDampingRatio
public NumericProperty getDampingRatio()
-
set
public void set(NumericPropertyKeyword type, NumericProperty property)
Description copied from class:GradientBasedOptimiserThe accepted types are:GRADIENT_RESOLUTION, ERROR_TOLERANCE, ITERATION_LIMIT.- Overrides:
setin classGradientBasedOptimiser- Parameters:
type- the type, which must be equal by definition toproperty.getType().property- the property, which contains new information.
-
setDampingRatio
public void setDampingRatio(NumericProperty dampingRatio)
-
-