de.jstacs.algorithms.optimization
Class DifferentiableFunction

java.lang.Object
  extended by de.jstacs.algorithms.optimization.DifferentiableFunction
All Implemented Interfaces:
Function
Direct Known Subclasses:
LogPrior, NegativeDifferentiableFunction, NumericalDifferentiableFunction, OptimizableFunction

public abstract class DifferentiableFunction
extends Object
implements Function

This class is the framework for any (at least) one time differentiable function $f: \mathbb{R}^n \to \mathbb{R}$.

Author:
Jens Keilwagen

Constructor Summary
DifferentiableFunction()
           
 
Method Summary
abstract  double[] evaluateGradientOfFunction(double[] x)
          Evaluates the gradient of a function at a certain vector (in mathematical sense) x, i.e., $\nabla f(\underline{x}) = \left(\frac{\partial f(\underline{x})}{\partial x_1},\ldots,\frac{\partial f(\underline{x})}{\partial x_n}\right)$.
protected  double[] findOneDimensionalMin(double[] x, double[] d, double alpha_0, double fAlpha_0, double linEps, double startDistance)
          This method is used to find an approximation of an one-dimensional subfunction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.jstacs.algorithms.optimization.Function
evaluateFunction, getDimensionOfScope
 

Constructor Detail

DifferentiableFunction

public DifferentiableFunction()
Method Detail

evaluateGradientOfFunction

public abstract double[] evaluateGradientOfFunction(double[] x)
                                             throws DimensionException,
                                                    EvaluationException
Evaluates the gradient of a function at a certain vector (in mathematical sense) x, i.e., $\nabla f(\underline{x}) = \left(\frac{\partial f(\underline{x})}{\partial x_1},\ldots,\frac{\partial f(\underline{x})}{\partial x_n}\right)$.

Parameters:
x - the current vector
Returns:
the evaluation of the gradient of a function, has dimension Function.getDimensionOfScope()
Throws:
DimensionException - if dim(x) != n, with $f: \mathbb{R}^n \to \mathbb{R}$
EvaluationException - if there was something wrong during the evaluation of the gradient
See Also:
Function.getDimensionOfScope()

findOneDimensionalMin

protected double[] findOneDimensionalMin(double[] x,
                                         double[] d,
                                         double alpha_0,
                                         double fAlpha_0,
                                         double linEps,
                                         double startDistance)
                                  throws DimensionException,
                                         EvaluationException
This method is used to find an approximation of an one-dimensional subfunction. That means it will find an approximation of the minimum starting at point x and search in direction d,
%preamble{\usepackage{amsmath}} \[\operatorname{argmin}_{\alpha
. This method is a standard implementation. You are enabled to overwrite this method to be faster if you know anything about the problem or if you just want to test other line search methods.

Parameters:
x - the start point
d - the search direction
alpha_0 - the initial alpha
fAlpha_0 - the initial function value (this value is known in most cases and does not have to be computed again)
linEps - the tolerance for stopping this method
startDistance - the initial distance for bracketing the minimum
Returns:
double[2] res = { alpha*, f(alpha*) }
Throws:
DimensionException - if there is something wrong with the dimension
EvaluationException - if there was something wrong during the evaluation of the function
See Also:
OneDimensionalFunction.findMin(double, double, double, double)