pal.math

## Class MultivariateMinimum

• ### Field Summary

Fields
Modifier and Type Field and Description
`int` `maxFun`
maxFun is the maximum number of calls to fun allowed.
`int` `numFun`
total number of function evaluations necessary
`int` `numFuncStops`
numFuncStops is the number of consecutive positive evaluations of the stop criterion based on function evaluation necessary to cause the abortion of the optimization (default is 4)
• ### Constructor Summary

Constructors
Constructor and Description
`MultivariateMinimum()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`void` ```copy(double[] target, double[] source)```
Copy source vector into target vector
`double` ```findMinimum(MultivariateFunction f, double[] xvec)```
Find minimum close to vector x
`double` ```findMinimum(MultivariateFunction f, double[] xvec, int fxFracDigits, int xFracDigits)```
Find minimum close to vector x (desired fractional digits for each parameter is specified)
`abstract void` ```optimize(MultivariateFunction f, double[] xvec, double tolfx, double tolx)```
The actual optimization routine (needs to be implemented in a subclass of MultivariateMinimum).
`boolean` ```stopCondition(double fx, double[] x, double tolfx, double tolx, boolean firstCall)```
Checks whether optimization should stop
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### numFun

`public int numFun`
total number of function evaluations necessary
• #### maxFun

`public int maxFun`
maxFun is the maximum number of calls to fun allowed. the default value of 0 indicates no limit on the number of calls.
• #### numFuncStops

`public int numFuncStops`
numFuncStops is the number of consecutive positive evaluations of the stop criterion based on function evaluation necessary to cause the abortion of the optimization (default is 4)
• ### Constructor Detail

• #### MultivariateMinimum

`public MultivariateMinimum()`
• ### Method Detail

• #### findMinimum

```public double findMinimum(MultivariateFunction f,
double[] xvec)```
Find minimum close to vector x
Parameters:
`f` - multivariate function
`xvec` - initial guesses for the minimum (contains the location of the minimum on return)
Returns:
minimal function value
• #### findMinimum

```public double findMinimum(MultivariateFunction f,
double[] xvec,
int fxFracDigits,
int xFracDigits)```
Find minimum close to vector x (desired fractional digits for each parameter is specified)
Parameters:
`f` - multivariate function
`xvec` - initial guesses for the minimum (contains the location of the minimum on return)
`fxFracDigits` - desired fractional digits in the function value
`xFracDigits` - desired fractional digits in parameters x
Returns:
minimal function value
• #### optimize

```public abstract void optimize(MultivariateFunction f,
double[] xvec,
double tolfx,
double tolx)```
The actual optimization routine (needs to be implemented in a subclass of MultivariateMinimum). It finds a minimum close to vector x when the absolute tolerance for each parameter is specified.
Parameters:
`f` - multivariate function
`xvec` - initial guesses for the minimum (contains the location of the minimum on return)
`tolfx` - absolute tolerance of function value
`tolx` - absolute tolerance of each parameter
• #### stopCondition

```public boolean stopCondition(double fx,
double[] x,
double tolfx,
double tolx,
boolean firstCall)```
Checks whether optimization should stop
Parameters:
`fx` - current function value
`x` - current values of function parameters
`tolfx` - absolute tolerance of function value
`tolx` - absolute tolerance of each parameter
`firstCall` - needs to be set to true when this routine is first called otherwise it should be set to false
Returns:
true if either x and its previous value are sufficiently similar or if fx and its previous values are sufficiently similar (test on function value has to be succesful numFuncStops consecutive times)
• #### copy

```public void copy(double[] target,
double[] source)```
Copy source vector into target vector
Parameters:
`target` - parameter array
`source` - parameter array