|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer<FUNC>
org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateSimpleBoundsOptimizer<MultivariateFunction>
org.apache.commons.math3.optimization.direct.BOBYQAOptimizer
@Deprecated public class BOBYQAOptimizer
Powell's BOBYQA algorithm. This implementation is translated and
adapted from the Fortran version available
here.
See
this paper for an introduction.
BOBYQA is particularly well suited for high dimensional problems
where derivatives are not available. In most cases it outperforms the
PowellOptimizer
significantly. Stochastic algorithms like
CMAESOptimizer
succeed more often than BOBYQA, but are more
expensive. BOBYQA could also be considered as a replacement of any
derivative-based optimizer when the derivatives are approximated by
finite differences.
Nested Class Summary | |
---|---|
private static class |
BOBYQAOptimizer.PathIsExploredException
Deprecated. Marker for code paths that are not explored with the current unit tests. |
Field Summary | |
---|---|
private ArrayRealVector |
alternativeNewPoint
Deprecated. Alternative to newPoint , chosen by
altmov . |
private Array2DRowRealMatrix |
bMatrix
Deprecated. Last n columns of matrix H (where n is the dimension of the problem). |
private double[] |
boundDifference
Deprecated. Differences between the upper and lower bounds. |
private ArrayRealVector |
currentBest
Deprecated. Current best values for the variables to be optimized. |
static double |
DEFAULT_INITIAL_RADIUS
Deprecated. Default value for initialTrustRegionRadius : 10.0 . |
static double |
DEFAULT_STOPPING_RADIUS
Deprecated. Default value for stoppingTrustRegionRadius : 1.0E-8 . |
private ArrayRealVector |
fAtInterpolationPoints
Deprecated. Values of the objective function at the interpolation points. |
private ArrayRealVector |
gradientAtTrustRegionCenter
Deprecated. Gradient of the quadratic model at originShift +
trustRegionCenterOffset . |
private static double |
HALF
Deprecated. |
private double |
initialTrustRegionRadius
Deprecated. initialTrustRegionRadius XXX |
private Array2DRowRealMatrix |
interpolationPoints
Deprecated. Coordinates of the interpolation points relative to originShift . |
private boolean |
isMinimize
Deprecated. Goal type (minimize or maximize). |
private ArrayRealVector |
lagrangeValuesAtNewPoint
Deprecated. Values of the Lagrange functions at a new point. |
private ArrayRealVector |
lowerDifference
Deprecated. Differences BaseAbstractMultivariateSimpleBoundsOptimizer.getLowerBound() - originShift . |
static int |
MINIMUM_PROBLEM_DIMENSION
Deprecated. Minimum dimension of the problem: 2 |
private static double |
MINUS_ONE
Deprecated. |
private ArrayRealVector |
modelSecondDerivativesParameters
Deprecated. Parameters of the implicit second derivatives of the quadratic model. |
private ArrayRealVector |
modelSecondDerivativesValues
Deprecated. Explicit second derivatives of the quadratic model. |
private ArrayRealVector |
newPoint
Deprecated. Point chosen by function trsbox
or altmov . |
private int |
numberOfInterpolationPoints
Deprecated. numberOfInterpolationPoints XXX |
private static double |
ONE
Deprecated. |
private static double |
ONE_OVER_A_THOUSAND
Deprecated. |
private static double |
ONE_OVER_EIGHT
Deprecated. |
private static double |
ONE_OVER_FOUR
Deprecated. |
private static double |
ONE_OVER_TEN
Deprecated. |
private ArrayRealVector |
originShift
Deprecated. Shift of origin that should reduce the contributions from rounding errors to values of the model and Lagrange functions. |
private static double |
SIXTEEN
Deprecated. |
private double |
stoppingTrustRegionRadius
Deprecated. stoppingTrustRegionRadius XXX |
private static double |
TEN
Deprecated. |
private ArrayRealVector |
trialStepPoint
Deprecated. Trial step from trustRegionCenterOffset which is usually
newPoint - trustRegionCenterOffset . |
private int |
trustRegionCenterInterpolationPointIndex
Deprecated. Index of the interpolation point at the trust region center. |
private ArrayRealVector |
trustRegionCenterOffset
Deprecated. Displacement from originShift of the trust region center. |
private static double |
TWO
Deprecated. |
private static double |
TWO_HUNDRED_FIFTY
Deprecated. |
private ArrayRealVector |
upperDifference
Deprecated. Differences BaseAbstractMultivariateSimpleBoundsOptimizer.getUpperBound() - originShift
All the components of every trustRegionCenterOffset are going
to satisfy the boundstrustRegionCenterOffset i ≤
upperBound i,with appropriate equalities when trustRegionCenterOffset is
on a constraint boundary. |
private static double |
ZERO
Deprecated. |
private Array2DRowRealMatrix |
zMatrix
Deprecated. Factorization of the leading npt square submatrix of H, this factorization being Z ZT, which provides both the correct rank and positive semi-definiteness. |
Fields inherited from class org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer |
---|
evaluations |
Constructor Summary | |
---|---|
BOBYQAOptimizer(int numberOfInterpolationPoints)
Deprecated. |
|
BOBYQAOptimizer(int numberOfInterpolationPoints,
double initialTrustRegionRadius,
double stoppingTrustRegionRadius)
Deprecated. |
Method Summary | |
---|---|
private double[] |
altmov(int knew,
double adelt)
Deprecated. The arguments N, NPT, XPT, XOPT, BMAT, ZMAT, NDIM, SL and SU all have the same meanings as the corresponding arguments of BOBYQB. |
private double |
bobyqa(double[] lowerBound,
double[] upperBound)
Deprecated. This subroutine seeks the least value of a function of many variables, by applying a trust region method that forms quadratic models by interpolation. |
private double |
bobyqb(double[] lowerBound,
double[] upperBound)
Deprecated. The arguments N, NPT, X, XL, XU, RHOBEG, RHOEND, IPRINT and MAXFUN are identical to the corresponding arguments in SUBROUTINE BOBYQA. |
private static java.lang.String |
caller(int n)
Deprecated. |
protected PointValuePair |
doOptimize()
Deprecated. Perform the bulk of the optimization algorithm. |
private static double[] |
fillNewArray(int n,
double value)
Deprecated. Creates a new array. |
private void |
prelim(double[] lowerBound,
double[] upperBound)
Deprecated. SUBROUTINE PRELIM sets the elements of XBASE, XPT, FVAL, GOPT, HQ, PQ, BMAT and ZMAT for the first iteration, and it maintains the values of NF and KOPT. |
private static void |
printMethod()
Deprecated. |
private static void |
printState(int s)
Deprecated. |
private void |
setup(double[] lowerBound,
double[] upperBound)
Deprecated. Performs validity checks. |
private double[] |
trsbox(double delta,
ArrayRealVector gnew,
ArrayRealVector xbdi,
ArrayRealVector s,
ArrayRealVector hs,
ArrayRealVector hred)
Deprecated. A version of the truncated conjugate gradient is applied. |
private void |
update(double beta,
double denom,
int knew)
Deprecated. The arrays BMAT and ZMAT are updated, as required by the new position of the interpolation point that has the index KNEW. |
Methods inherited from class org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateSimpleBoundsOptimizer |
---|
getLowerBound, getUpperBound, optimize, optimize |
Methods inherited from class org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer |
---|
computeObjectiveValue, getConvergenceChecker, getEvaluations, getGoalType, getMaxEvaluations, getStartPoint, optimize, optimizeInternal, optimizeInternal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.math3.optimization.BaseMultivariateOptimizer |
---|
optimize |
Methods inherited from interface org.apache.commons.math3.optimization.BaseOptimizer |
---|
getConvergenceChecker, getEvaluations, getMaxEvaluations |
Field Detail |
---|
public static final int MINIMUM_PROBLEM_DIMENSION
public static final double DEFAULT_INITIAL_RADIUS
initialTrustRegionRadius
: 10.0 .
public static final double DEFAULT_STOPPING_RADIUS
stoppingTrustRegionRadius
: 1.0E-8 .
private static final double ZERO
private static final double ONE
private static final double TWO
private static final double TEN
private static final double SIXTEEN
private static final double TWO_HUNDRED_FIFTY
private static final double MINUS_ONE
private static final double HALF
private static final double ONE_OVER_FOUR
private static final double ONE_OVER_EIGHT
private static final double ONE_OVER_TEN
private static final double ONE_OVER_A_THOUSAND
private final int numberOfInterpolationPoints
private double initialTrustRegionRadius
private final double stoppingTrustRegionRadius
private boolean isMinimize
private ArrayRealVector currentBest
private double[] boundDifference
private int trustRegionCenterInterpolationPointIndex
private Array2DRowRealMatrix bMatrix
private Array2DRowRealMatrix zMatrix
private Array2DRowRealMatrix interpolationPoints
originShift
.
XXX "xpt" in the original code.
private ArrayRealVector originShift
private ArrayRealVector fAtInterpolationPoints
private ArrayRealVector trustRegionCenterOffset
originShift
of the trust region center.
XXX "xopt" in the original code.
private ArrayRealVector gradientAtTrustRegionCenter
originShift
+
trustRegionCenterOffset
.
XXX "gopt" in the original code.
private ArrayRealVector lowerDifference
BaseAbstractMultivariateSimpleBoundsOptimizer.getLowerBound()
- originShift
.
All the components of every trustRegionCenterOffset
are going
to satisfy the boundslowerBound
i ≤
trustRegionCenterOffset
i,trustRegionCenterOffset
is
on a constraint boundary.
XXX "sl" in the original code.
private ArrayRealVector upperDifference
BaseAbstractMultivariateSimpleBoundsOptimizer.getUpperBound()
- originShift
All the components of every trustRegionCenterOffset
are going
to satisfy the boundstrustRegionCenterOffset
i ≤
upperBound
i,trustRegionCenterOffset
is
on a constraint boundary.
XXX "su" in the original code.
private ArrayRealVector modelSecondDerivativesParameters
private ArrayRealVector newPoint
trsbox
or altmov
.
Usually originShift
+ newPoint
is the vector of
variables for the next evaluation of the objective function.
It also satisfies the constraints indicated in lowerDifference
and upperDifference
.
XXX "xnew" in the original code.
private ArrayRealVector alternativeNewPoint
newPoint
, chosen by
altmov
.
It may replace newPoint
in order to increase the denominator
in the updating procedure
.
XXX "xalt" in the original code.
private ArrayRealVector trialStepPoint
trustRegionCenterOffset
which is usually
newPoint
- trustRegionCenterOffset
.
XXX "d__" in the original code.
private ArrayRealVector lagrangeValuesAtNewPoint
private ArrayRealVector modelSecondDerivativesValues
Constructor Detail |
---|
public BOBYQAOptimizer(int numberOfInterpolationPoints)
numberOfInterpolationPoints
- Number of interpolation conditions.
For a problem of dimension n
, its value must be in the interval
[n+2, (n+1)(n+2)/2]
.
Choices that exceed 2n+1
are not recommended.public BOBYQAOptimizer(int numberOfInterpolationPoints, double initialTrustRegionRadius, double stoppingTrustRegionRadius)
numberOfInterpolationPoints
- Number of interpolation conditions.
For a problem of dimension n
, its value must be in the interval
[n+2, (n+1)(n+2)/2]
.
Choices that exceed 2n+1
are not recommended.initialTrustRegionRadius
- Initial trust region radius.stoppingTrustRegionRadius
- Stopping trust region radius.Method Detail |
---|
protected PointValuePair doOptimize()
doOptimize
in class BaseAbstractMultivariateOptimizer<MultivariateFunction>
private double bobyqa(double[] lowerBound, double[] upperBound)
lowerBound
- Lower bounds.upperBound
- Upper bounds.
private double bobyqb(double[] lowerBound, double[] upperBound)
lowerBound
- Lower bounds.upperBound
- Upper bounds.
private double[] altmov(int knew, double adelt)
knew
- adelt
- private void prelim(double[] lowerBound, double[] upperBound)
lowerBound
- Lower bounds.upperBound
- Upper bounds.private double[] trsbox(double delta, ArrayRealVector gnew, ArrayRealVector xbdi, ArrayRealVector s, ArrayRealVector hs, ArrayRealVector hred)
delta
- gnew
- xbdi
- s
- hs
- hred
- private void update(double beta, double denom, int knew)
beta
- denom
- knew
- private void setup(double[] lowerBound, double[] upperBound)
lowerBound
- Lower bounds (constraints) of the objective variables.upperBound
- Upperer bounds (constraints) of the objective variables.private static double[] fillNewArray(int n, double value)
n
- Dimension of the returned array.value
- Value for each element.
n
elements set to the given
value
.private static java.lang.String caller(int n)
private static void printState(int s)
private static void printMethod()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |