Confused about substituting constraints into objective in lagarange function

55 Views Asked by At

I have an optimization problem, say, to minimize the variance of a portfolio with weights $w$ and the constraint is that the expection should be equal to $z$.

$$ \begin{aligned} \min \quad& \text{Var}[R_w] \\ \text{subject to }\quad & \mathbb E[R_w] = z \end{aligned} $$

The Lagrange will have the form $$ L(w, \lambda) = \text{Var}[R_w] + \lambda(\mathbb E[R_w] - z) $$

I saw in some textbooks that the Lagrange function is then simplified as $$ L(w, \lambda) = \mathbb E[R_w^2] - z^2 + \lambda(\mathbb E[R_w] - z) $$

That is where I feel confused. I understand that $\text{Var}[R_w]$ is substituted with $\mathbb E[R_w^2] - [\mathbb E[R_w]]^2$. But I am not sure why $\mathbb E[R_w]$ can be substituted by $z$. When can the constraint be substituted into the objective function?

1

There are 1 best solutions below

0
On

The short answer is: whenever it makes sense. The longer answer is that you must make sure you don't ignore any constraint. We can reformulate the problem as $$\min_x\; f(x) \\ s.t.\; g(x)=z$$ and since $f(x)=g(x^2)-[g(x)]^2=g(x^2)-z^2$, both Lagrangian forms are equivalent. The reason I reformulate the problem is to stress that $x$ is the the objective variable. Therefore substitutions that do not disregard any variables are allowed.