scalation.minima

NelderMeadSimplex

class NelderMeadSimplex extends Minimizer with Error

This class solves unconstrained Non-Linear Programming (NLP) problems using the Nelder-Mead Simplex algorithm. Given a function 'f' and its dimension 'n', the algorithm moves a simplex defined by n + 1 points in order to find an optimal solution. The algorithm is derivative-free.

minimize f(x)

Linear Supertypes
Error, Minimizer, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. NelderMeadSimplex
  2. Error
  3. Minimizer
  4. AnyRef
  5. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NelderMeadSimplex(f: (VectorD) ⇒ Double, n: Int)

    f

    the vector-to-scalar objective function

    n

    the dimension of the search space

Type Members

  1. type Vertex = (VectorD, Double)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val EPSILON: Double

    Attributes
    protected
    Definition Classes
    Minimizer
  7. val MAX_ITER: Int

    Attributes
    protected
    Definition Classes
    Minimizer
  8. val STEP: Double

    Attributes
    protected
    Definition Classes
    Minimizer
  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def centroid(): (VectorD, Double)

    Calculate the centroid of the best-side of the simplex (excluding h=0), returning it and its functional value.

  11. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def contractIn(x_c: VectorD, x_r: VectorD): (VectorD, Double)

    Contract: compute the inner contraction point between x_h and x_c.

    Contract: compute the inner contraction point between x_h and x_c.

    x_c

    the best-side centroid of the simplex

    x_r

    the reflection point

  13. def contractOut(x_c: VectorD, x_r: VectorD): (VectorD, Double)

    Contract: compute the outer contraction point between x_r and x_c.

    Contract: compute the outer contraction point between x_r and x_c.

    x_c

    the best-side centroid of the simplex

    x_r

    the reflection point

  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  16. def expand(x_c: VectorD, x_r: VectorD): (VectorD, Double)

    Expand: compute the expansion point beyond the reflection point.

    Expand: compute the expansion point beyond the reflection point.

    x_c

    the best-side centroid of the simplex

    x_r

    the reflection point

  17. def fg(x: VectorD): Double

    The objective function f plus a weighted penalty based on the constraint function g.

    The objective function f plus a weighted penalty based on the constraint function g. Override for constrained optimization and ignore for unconstrained optimization.

    x

    the coordinate values of the current point

    Definition Classes
    Minimizer
  18. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  19. def flaw(method: String, message: String): Unit

    Show the flaw by printing the error message.

    Show the flaw by printing the error message.

    method

    the method where the error occurred

    message

    the error message

    Definition Classes
    Error
  20. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  22. def improveSimplex(toler: Double = EPSILON): (Double, Double)

    Improve the simplex by replacing the worst/highest vertex (x_h) with a a better one found on the line containing x_h and the centroid (x_c).

    Improve the simplex by replacing the worst/highest vertex (x_h) with a a better one found on the line containing x_h and the centroid (x_c). Try the reflection, expansion, outer contraction and inner contraction points, in that order. If none succeeds, shrink the simplex and iterate. Return both distance and difference between x_h (worst) and x_l (best).

    toler

    the tolerence used for termination

  23. def initSimplex(x0: VectorD, step: Double): Unit

    Initialize the search simplex by setting n + 1 vertices and computing their functional values.

    Initialize the search simplex by setting n + 1 vertices and computing their functional values.

    x0

    the given starting point

    step

    the step size

  24. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  25. def lineSearch(x: VectorD, dir: VectorD, step: Double = STEP): Double

    Perform an exact (e.

    Perform an exact (e.g., GoldenSectionLS) or inexact (e.g., WolfeLS) line search. Search in direction 'dir', returning the distance 'z' to move in that direction. Currently NOT USED, but may be used to find a better point to add to simplex.

    x

    the current point

    dir

    the direction to move in

    step

    the initial step size

    Definition Classes
    NelderMeadSimplexMinimizer
  26. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  29. def reflect(x_c: VectorD): (VectorD, Double)

    Reflect: compute the reflection point of the worst point (h=0) across the centroid.

    Reflect: compute the reflection point of the worst point (h=0) across the centroid.

    x_c

    the best-side centroid of the simplex

  30. def replace(x_n: VectorD): Unit

    Replace the worst vertex (h=0) in the simplex with the new point.

    Replace the worst vertex (h=0) in the simplex with the new point.

    x_n

    the new replacement point

  31. def shrink(): Unit

    Shrink: fixing the best/lowest point (l=n), move the rest of the points toward it.

  32. def solve(x0: VectorD, step: Double = STEP, toler: Double = EPSILON): VectorD

    Solve the Non-Linear Programming (NLP) problem using the Nelder-Mead Simplex algorithm.

    Solve the Non-Linear Programming (NLP) problem using the Nelder-Mead Simplex algorithm.

    x0

    the given starting point

    step

    the initial step size

    toler

    the tolerence used for termination

    Definition Classes
    NelderMeadSimplexMinimizer
  33. def sort(): Unit

    Sort the vertices in non-increasing order (high to low).

    Sort the vertices in non-increasing order (high to low). Then the key indices are worst/highest (h=0), second worst (s=1), and best/lowest (l=n).

  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  35. def toString(): String

    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  37. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  38. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Error

Inherited from Minimizer

Inherited from AnyRef

Inherited from Any