Difference between revisions of "OptShadow"
(Renamed LP* funcitons to Opt* in Analytica 4.3) |
|||
Line 2: | Line 2: | ||
[[Category:Doc Status D]] <!-- For Lumina use, do not change --> | [[Category:Doc Status D]] <!-- For Lumina use, do not change --> | ||
− | = | + | '''Prior to Analytica 4.3, formerly named [[LpShadow]]''' |
+ | |||
+ | = OptShadow(lp) = | ||
+ | |||
Returns the shadow prices, or dual values, for the constraints at the optimal solution. | Returns the shadow prices, or dual values, for the constraints at the optimal solution. | ||
Line 68: | Line 71: | ||
When you relax a constraint, the objective will always either improve or stay the same. Thus, for a minimization problem, the shadow price of a '<' constraint is always negative or zero, and for a maximization problem it is positive or zero. For a '>' constraint the opposite holds. | When you relax a constraint, the objective will always either improve or stay the same. Thus, for a minimization problem, the shadow price of a '<' constraint is always negative or zero, and for a maximization problem it is positive or zero. For a '>' constraint the opposite holds. | ||
− | Constraints with zero shadow prices have [[ | + | Constraints with zero shadow prices have [[OptSlack|slack]] -- that is, they are not constraining the optimal solution. |
Not all linear programming packages use the same convention for the sign of shadow prices. The LINDO package, for example, uses a different convention for the sign. | Not all linear programming packages use the same convention for the sign of shadow prices. The LINDO package, for example, uses a different convention for the sign. | ||
Line 74: | Line 77: | ||
= See Also = | = See Also = | ||
− | * [[ | + | * [[OptReducedCost]] |
− | * [[LpDefine]] | + | * [[DefineOptimization]] (former to Analytica 4.3, see [[LpDefine]]) |
− | * [[ | + | * [[OptObjective]], [[OptSolution]], [[OptStatusText]], [[OptStatusNum]] |
Revision as of 21:06, 22 September 2010
Prior to Analytica 4.3, formerly named LpShadow
OptShadow(lp)
Returns the shadow prices, or dual values, for the constraints at the optimal solution.
The shadow price is the amount by which the objective function changes when the constraint is altered by increasing its right-hand side coefficient, bi, by one unit. It is valid only for small changes in bi, and mathematically is defined as:
This is the partial derivative of the objective function relative to the constraint RHS coefficient.
For a '<=' constraint and maximization problem, a shadow price indicates the amount the objective function improves when the constraint is relaxed. Shadow prices are usually meaningful when you are thinking of them in these terms. However, you should pay attention to the partial derivative definition to get the sign right.
The shadow can only be computed for continuous optimization problems. The shadow price does not exist for integer or mixed-integer optimizations, so can only be computed if every variable in the optimization problem is continuous.
For continuous problems, whether the shadow price can be computed depends upon the problem type and solver engine used. The following table summarizes the combinations for which shadow price can be computed (QP=quadratic objective + linear constraints, QCP = quadratically constrained):
"Problem Type" | ||||
---|---|---|---|---|
Engine | LP | QP | QCP | NLP |
LP/Quadratic | Y | - | - | - |
SOCP Barrier | Y | Y | N | - |
GRG Nonlinear | Y | Y | Y | Y |
Evolutionary | N | N | N | N |
LSLP | Y | - | - | - |
LSGRG | Y | Y | Y | Y |
LSSQP | Y | Y | Y | - |
OptQuest | N | N | N | N |
MOSEK | Y | Y | N | N |
Knitro | Y | Y | Y | Y |
XPress | Y | - | - | - |
Gurobi | Y | - | - | - |
This table may not be 100% accurate. [To do: empircally validate these entries]
Notes
When you relax a constraint, the objective will always either improve or stay the same. Thus, for a minimization problem, the shadow price of a '<' constraint is always negative or zero, and for a maximization problem it is positive or zero. For a '>' constraint the opposite holds.
Constraints with zero shadow prices have slack -- that is, they are not constraining the optimal solution.
Not all linear programming packages use the same convention for the sign of shadow prices. The LINDO package, for example, uses a different convention for the sign.
See Also
- OptReducedCost
- DefineOptimization (former to Analytica 4.3, see LpDefine)
- OptObjective, OptSolution, OptStatusText, OptStatusNum
Enable comment auto-refresher