OptShadow

Revision as of 19:47, 28 January 2010 by Lchrisman (talk | contribs)


LpShadow(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:

Shadow price eq.png

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.

«lp» must be an LP returned by a previous call to LpDefine. Although the concept of a shadow price applies equally well to QPs and NLPs, this function can only be used with LPs.

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 teh sign of shadow prices. The LINDO package, for example, uses a different convention for the sign.

See Also

Comments


You are not allowed to post comments.