Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.algorithms.optimization
Class NumericalDifferentiableFunction

    java.lang.Object
      de.jstacs.algorithms.optimization.DifferentiableFunction
          de.jstacs.algorithms.optimization.NumericalDifferentiableFunction

All Implemented Interfaces:
  Function

    public abstract class NumericalDifferentiableFunction

extends DifferentiableFunction

This class is the framework for any function f: R^n -> R. The gradient is computed numerically. Each partial differentiation is computed by the formula
\partial_k f(x) = \frac{f(x)-f(x+\varepsilon*e_k)}{\varepsilon}

Author:
  Jens Keilwagen

Field Summary
`protected double` | `eps` The constant used in the computation of the gradient.

Constructor Summary
`NumericalDifferentiableFunction(double epsilon)`

Method Summary
`double[]` | `evaluateGradientOfFunction(double[] x)` Evaluates the gradient of function at a certain vector (in mathematical sense) `x` numerically.

Methods inherited from class de.jstacs.algorithms.optimization.DifferentiableFunction
`findOneDimensionalMin`

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`

Field Detail

### eps

    protected double eps

  The constant used in the computation of the gradient. Sould be close to 0 but not exactly 0.

Constructor Detail

### NumericalDifferentiableFunction

    public NumericalDifferentiableFunction(double epsilon)
                                    throws IllegalArgumentException

Parameters:
  `epsilon` - the epsilon used for the numerical differentiation
Throws:
  `IllegalArgumentException` - if epsilon = 0;

Method Detail

### evaluateGradientOfFunction

    public double[] evaluateGradientOfFunction(double[] x)
                                        throws DimensionException,
                                               EvaluationException

  Evaluates the gradient of function at a certain vector (in mathematical sense) `x` numerically.

  Specified by:
    `evaluateGradientOfFunction` in class `DifferentiableFunction`
  Parameters:
    `x` - the current vector
  Returns:
    the elvaluation of the gradient of a function; has dimension `getDimensionOfScope()`
  Throws:
    `DimensionException` - if dim(x) != n, with f: R^n -> R
    `EvaluationException` - if there was a mistake in evaluating the gradient
  See Also:
    `Function.getDimensionOfScope()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD