Shadow price of an inequality constraint (source code)

= Shadow price of an inequality constraint
{title2=$\partial V/\partial b_i=-\lambda_i$}

A shadow price measures the marginal improvement from relaxing an inequality <optimization constraint>. Use $L=f+\sum_i\lambda_i(g_i-b_i)+\sum_j\mu_jh_j$ for $g_i(x)\leq b_i$ in a <minimization problem>. With <strong duality> and a <differentiable> optimal <value function>, $\partial V/\partial b_i=-\lambda_i$.<Convex Optimization by Stephen Boyd and Lieven Vandenberghe>[§5.6.3, printed pp. 251–252, equation (5.58): local sensitivity]{ref}

In the <quadratic minimization with a moving upper bound>, direct <differentiation> gives
$$
V'(b)=
\begin{cases}
-2(2-b),&b<2,\\
0,&b\geq2,
\end{cases}
\qquad V'(b)=-\lambda_*(b).
$$
The <derivative> at $b=2$ is zero from both sides, although $x_*(b)$ has different one-sided <derivatives> there. The value of additional room has faded continuously to zero just as the <active constraint> stops restricting the optimizer.

At $b=1$, $x_*=1$, $V=1$ and $\lambda_*=2$. Raising the bound to $1.1$ lowers the value to $0.81$: the first-order prediction is a change of $-2(0.1)=-0.2$, while the exact change is $-0.19$. At $b=3$, the same relaxation leaves $x_*=2$ and $V=0$. At $b=2$, tightening by $0.1$ costs $0.01$, a second-order effect despite the zero <Lagrange multiplier>.

\Image[/kkt-shadow-price-value-and-multiplier.png]
{title=The derivative of the optimal value is the negative inequality multiplier}

There is also a global statement in this example. Keeping the <Lagrange multiplier> at the value associated with $b_0$, the <Lagrange dual function> changes by $-\lambda_*(b_0)(b-b_0)$. <Weak duality> therefore gives
$$
V(b)\geq V(b_0)-\lambda_*(b_0)(b-b_0).
$$
At $b_0=1$ this is $V(b)\geq3-2b$, the supporting tangent shown in the diagram. This bound remains valid for large changes, whereas the <derivative> predicts only the first-order effect. If the <value function> is not <differentiable>, an optimal <Lagrange multiplier> can instead supply a supporting <subgradient>, rather than a unique marginal rate. This is the same idea used in <sensitivity analysis in convex perturbation duality>.