|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.optimization.constrained.general.penaltymethod.PenaltyMethod
public class PenaltyMethod
The penalty method is an algorithm for solving the constrained minimization problem for general constraints. It replaces a constrained optimization problem by a series of unconstrained problems whose solutions ideally converge to the solution of the original constrained problem. The unconstrained problems are formed by adding a term to the objective function that consists of a penalty parameter and a measure of violation of the constraints. The measure of violation is nonzero when the constraints are violated and is zero in the region where constraints are not violated.
In this implementation, we use only one iteration. In this iteration, we multiply the penalties by γ, which is a very big number, to penalize a solver outside the feasible region. This is to mimic when γ approaches infinity. The classical unconstrained minimization is then applied to the modified problem. It can be shown that if the penalty is large enough, the original and modified problem have the same solver.
| Nested Class Summary | |
|---|---|
static interface |
PenaltyMethod.PenaltyFunctionFactory
This defines a penalty function when a constrain is violated. |
| Field Summary | |
|---|---|
static PenaltyMethod.PenaltyFunctionFactory |
DEFAULT_PENALTY_FUNCTION_FACTORY
the default penalty function factory |
double |
gamma
γ as in R. |
PenaltyMethod.PenaltyFunctionFactory |
penaltyFunctionFactory
a way to construct a penalty function from a constrained optimization problem |
UnconstrainedMinimizer |
solver
the unconstrained solver class |
| Constructor Summary | |
|---|---|
PenaltyMethod()
Construct a PenaltyMethod solver for a constrained minimization problem using defaults. |
|
PenaltyMethod(double gamma)
Construct a PenaltyMethod solver for a constrained minimization problem using defaults. |
|
PenaltyMethod(PenaltyMethod.PenaltyFunctionFactory penaltyFunctionFactory,
double gamma,
UnconstrainedMinimizer solver)
Construct a PenaltyMethod solver for a constrained minimization problem. |
|
| Method Summary | |
|---|---|
double |
minimum()
Get the minimum found. |
Vector |
search(int maxIterations,
Vector... initials)
Search for a minimizer that minimizes the objective function from the given starting points. |
void |
solve(ConstrainedProblem problem,
double tol)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final PenaltyMethod.PenaltyFunctionFactory DEFAULT_PENALTY_FUNCTION_FACTORY
public final PenaltyMethod.PenaltyFunctionFactory penaltyFunctionFactory
public final double gamma
public final UnconstrainedMinimizer solver
| Constructor Detail |
|---|
public PenaltyMethod(PenaltyMethod.PenaltyFunctionFactory penaltyFunctionFactory,
double gamma,
UnconstrainedMinimizer solver)
penaltyFunctionFactory - the penalty function factorygamma - γ as in R. Fletchersolver - the unconstrained solver classpublic PenaltyMethod(double gamma)
The user may want to experiment different γ's to get better results. It should be big enough to reflect the penalty, but it cannot be too big to overflow the computations (to produce NaNs).
gamma - γ as in R. Fletcherpublic PenaltyMethod()
| Method Detail |
|---|
public void solve(ConstrainedProblem problem,
double tol)
solve in interface ConstrainedMinimizer
public Vector search(int maxIterations,
Vector... initials)
Minimizer
search in interface MinimizermaxIterations - the maximum number of iterationsinitials - the initial guesses; they could include information such as boundaries
public double minimum()
MinimizerThis is especially useful for an objective function that takes a long time to compute.
minimum in interface Minimizer
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||