why is $sumlimits_{i=1}^{n}v_ix_i(1-x_i)=v^Tx+x^T diag(v)x?$ and its dual function
up vote
2
down vote
favorite
I saw the solution of this question,but i have some problem
Q: min$_x c^T mathbf x$
$s.t. mathbf A mathbf x le mathbf b,mathbf x_i(1-mathbf x_i)=0,i=1,...,n,$ where $mathbf x =[x_1,...,x_n]^T$,find its dual function
Solution:
begin{align}
L(x, mu ,v) & = c^Tx+mu ^T(Ax-b)-sumlimits_{i=1}^{n}v_ix_i(1-x_i) \ & =c^Tx+mu ^T(Ax-b)-v^Tx+x^T diag(v)x \
end{align}
then minimizing over $x $ gives the dual function
$g(mu,v)=-b^Tmu - frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,when $v ge 0$ ,otherwise,it is $-infty$
I want to ask
$1.$ why is $sumlimits_{i=1}^{n}v_ix_i(1-x_i)=v^Tx+x^T diag(v)x?$ it seems that $sumlimits_{i=1}^{n}v_i(1-x_i)=x^T diag(v)x, $ why?
$2.$Why is $ L(x, mu ,v)=g(mu,v)=-b^Tmu - frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,when $v ge 0$
convex-analysis convex-optimization duality-theorems
add a comment |
up vote
2
down vote
favorite
I saw the solution of this question,but i have some problem
Q: min$_x c^T mathbf x$
$s.t. mathbf A mathbf x le mathbf b,mathbf x_i(1-mathbf x_i)=0,i=1,...,n,$ where $mathbf x =[x_1,...,x_n]^T$,find its dual function
Solution:
begin{align}
L(x, mu ,v) & = c^Tx+mu ^T(Ax-b)-sumlimits_{i=1}^{n}v_ix_i(1-x_i) \ & =c^Tx+mu ^T(Ax-b)-v^Tx+x^T diag(v)x \
end{align}
then minimizing over $x $ gives the dual function
$g(mu,v)=-b^Tmu - frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,when $v ge 0$ ,otherwise,it is $-infty$
I want to ask
$1.$ why is $sumlimits_{i=1}^{n}v_ix_i(1-x_i)=v^Tx+x^T diag(v)x?$ it seems that $sumlimits_{i=1}^{n}v_i(1-x_i)=x^T diag(v)x, $ why?
$2.$Why is $ L(x, mu ,v)=g(mu,v)=-b^Tmu - frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,when $v ge 0$
convex-analysis convex-optimization duality-theorems
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I saw the solution of this question,but i have some problem
Q: min$_x c^T mathbf x$
$s.t. mathbf A mathbf x le mathbf b,mathbf x_i(1-mathbf x_i)=0,i=1,...,n,$ where $mathbf x =[x_1,...,x_n]^T$,find its dual function
Solution:
begin{align}
L(x, mu ,v) & = c^Tx+mu ^T(Ax-b)-sumlimits_{i=1}^{n}v_ix_i(1-x_i) \ & =c^Tx+mu ^T(Ax-b)-v^Tx+x^T diag(v)x \
end{align}
then minimizing over $x $ gives the dual function
$g(mu,v)=-b^Tmu - frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,when $v ge 0$ ,otherwise,it is $-infty$
I want to ask
$1.$ why is $sumlimits_{i=1}^{n}v_ix_i(1-x_i)=v^Tx+x^T diag(v)x?$ it seems that $sumlimits_{i=1}^{n}v_i(1-x_i)=x^T diag(v)x, $ why?
$2.$Why is $ L(x, mu ,v)=g(mu,v)=-b^Tmu - frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,when $v ge 0$
convex-analysis convex-optimization duality-theorems
I saw the solution of this question,but i have some problem
Q: min$_x c^T mathbf x$
$s.t. mathbf A mathbf x le mathbf b,mathbf x_i(1-mathbf x_i)=0,i=1,...,n,$ where $mathbf x =[x_1,...,x_n]^T$,find its dual function
Solution:
begin{align}
L(x, mu ,v) & = c^Tx+mu ^T(Ax-b)-sumlimits_{i=1}^{n}v_ix_i(1-x_i) \ & =c^Tx+mu ^T(Ax-b)-v^Tx+x^T diag(v)x \
end{align}
then minimizing over $x $ gives the dual function
$g(mu,v)=-b^Tmu - frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,when $v ge 0$ ,otherwise,it is $-infty$
I want to ask
$1.$ why is $sumlimits_{i=1}^{n}v_ix_i(1-x_i)=v^Tx+x^T diag(v)x?$ it seems that $sumlimits_{i=1}^{n}v_i(1-x_i)=x^T diag(v)x, $ why?
$2.$Why is $ L(x, mu ,v)=g(mu,v)=-b^Tmu - frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,when $v ge 0$
convex-analysis convex-optimization duality-theorems
convex-analysis convex-optimization duality-theorems
edited Dec 3 at 15:26
asked Dec 3 at 13:18
shineele
377
377
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
In terms of indices,
$$v^Tx = sumlimits_i v_ix_i, text{ and } x^Tdiag(v)x = sumlimits_i x_iv_ix_i$$
therefore their difference is $$v^Tx - x^Tdiag(v)x = sumlimits_i v_ix_i(1-x_i)$$
I suspect you have an extra "$+x^Tv$" term in $L(x,mu,nu)$ that does not belong.
Setting $L(x,mu,nu) = c^Tx + mu^T(Ax-b) - v^Tx + x^Tdiag(v)x$ we get the minimum by taking
$$dL = c^T + mu^TA - v^T + 2v^T x = 0$$
and solve that $2v^Tx = v^T - c^T - mu^TA$, in other words
$$x_i = frac1{2v_i}(v_i-c_i-sum_j mu_jA_{j,i})$$
Now plug this into $L(x,mu,nu)$ to get $g(mu,nu)$.
ADDED: Ok, the reason you aren't getting the desired solution of $g(mu,nu)$ is that it has been copied down incorrectly. The correct solution is
$$g(mu,nu) = begin{cases}-b^Tmu - (1/4)sum_{i=1}^n(c_i + a_i^Tmu - nu_i)^2/nu_i&nu geq 0\-infty&text{else}end{cases}$$
Note the placement of the square outside of the parentheses. This problem is 5.13 from Boyd's textbook, and you may check that this is the correct solution by searching for a file from Stanford's course EE364a, Winter 2007-08 titled hw5sol.pdf.
After making this change, you should check that the solution we arrived at above does give the correct answer.
Lastly, it's a little easier to check the solution if you write the Lagrangian like this:
$$L(x,mu,nu) = x^Ttext{diag}(nu)x + (c + A^Tmu - nu)^Tx - b^Tmu$$
The algebra works like this: if $vX^2 + cX = -c^2/4v$ then the solution is $X = -c/2v$
you are right!!
– shineele
Dec 3 at 15:26
i still don't know how can i get $frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,i have already plug $x_i$ into $L(x,mu,v)$,but there are just lots of $x_i$
– shineele
Dec 4 at 15:02
@shineele I can't get it either, are you sure the formula for $g(mu,nu)$ is right? And did you double check the formula for $L(x,mu,nu)$? Where did this problem come from?
– Ben
Dec 4 at 16:17
yes,both of them i am sure,this problem is from Convex Optimization 5.13
– shineele
Dec 4 at 23:43
@shineele $g$ was wrong - see the new edit. A word of advice: include the source of the problem and where the solution is from when you ask such a question on here- you would get an answer much sooner this way!
– Ben
Dec 6 at 3:25
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
In terms of indices,
$$v^Tx = sumlimits_i v_ix_i, text{ and } x^Tdiag(v)x = sumlimits_i x_iv_ix_i$$
therefore their difference is $$v^Tx - x^Tdiag(v)x = sumlimits_i v_ix_i(1-x_i)$$
I suspect you have an extra "$+x^Tv$" term in $L(x,mu,nu)$ that does not belong.
Setting $L(x,mu,nu) = c^Tx + mu^T(Ax-b) - v^Tx + x^Tdiag(v)x$ we get the minimum by taking
$$dL = c^T + mu^TA - v^T + 2v^T x = 0$$
and solve that $2v^Tx = v^T - c^T - mu^TA$, in other words
$$x_i = frac1{2v_i}(v_i-c_i-sum_j mu_jA_{j,i})$$
Now plug this into $L(x,mu,nu)$ to get $g(mu,nu)$.
ADDED: Ok, the reason you aren't getting the desired solution of $g(mu,nu)$ is that it has been copied down incorrectly. The correct solution is
$$g(mu,nu) = begin{cases}-b^Tmu - (1/4)sum_{i=1}^n(c_i + a_i^Tmu - nu_i)^2/nu_i&nu geq 0\-infty&text{else}end{cases}$$
Note the placement of the square outside of the parentheses. This problem is 5.13 from Boyd's textbook, and you may check that this is the correct solution by searching for a file from Stanford's course EE364a, Winter 2007-08 titled hw5sol.pdf.
After making this change, you should check that the solution we arrived at above does give the correct answer.
Lastly, it's a little easier to check the solution if you write the Lagrangian like this:
$$L(x,mu,nu) = x^Ttext{diag}(nu)x + (c + A^Tmu - nu)^Tx - b^Tmu$$
The algebra works like this: if $vX^2 + cX = -c^2/4v$ then the solution is $X = -c/2v$
you are right!!
– shineele
Dec 3 at 15:26
i still don't know how can i get $frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,i have already plug $x_i$ into $L(x,mu,v)$,but there are just lots of $x_i$
– shineele
Dec 4 at 15:02
@shineele I can't get it either, are you sure the formula for $g(mu,nu)$ is right? And did you double check the formula for $L(x,mu,nu)$? Where did this problem come from?
– Ben
Dec 4 at 16:17
yes,both of them i am sure,this problem is from Convex Optimization 5.13
– shineele
Dec 4 at 23:43
@shineele $g$ was wrong - see the new edit. A word of advice: include the source of the problem and where the solution is from when you ask such a question on here- you would get an answer much sooner this way!
– Ben
Dec 6 at 3:25
add a comment |
up vote
1
down vote
In terms of indices,
$$v^Tx = sumlimits_i v_ix_i, text{ and } x^Tdiag(v)x = sumlimits_i x_iv_ix_i$$
therefore their difference is $$v^Tx - x^Tdiag(v)x = sumlimits_i v_ix_i(1-x_i)$$
I suspect you have an extra "$+x^Tv$" term in $L(x,mu,nu)$ that does not belong.
Setting $L(x,mu,nu) = c^Tx + mu^T(Ax-b) - v^Tx + x^Tdiag(v)x$ we get the minimum by taking
$$dL = c^T + mu^TA - v^T + 2v^T x = 0$$
and solve that $2v^Tx = v^T - c^T - mu^TA$, in other words
$$x_i = frac1{2v_i}(v_i-c_i-sum_j mu_jA_{j,i})$$
Now plug this into $L(x,mu,nu)$ to get $g(mu,nu)$.
ADDED: Ok, the reason you aren't getting the desired solution of $g(mu,nu)$ is that it has been copied down incorrectly. The correct solution is
$$g(mu,nu) = begin{cases}-b^Tmu - (1/4)sum_{i=1}^n(c_i + a_i^Tmu - nu_i)^2/nu_i&nu geq 0\-infty&text{else}end{cases}$$
Note the placement of the square outside of the parentheses. This problem is 5.13 from Boyd's textbook, and you may check that this is the correct solution by searching for a file from Stanford's course EE364a, Winter 2007-08 titled hw5sol.pdf.
After making this change, you should check that the solution we arrived at above does give the correct answer.
Lastly, it's a little easier to check the solution if you write the Lagrangian like this:
$$L(x,mu,nu) = x^Ttext{diag}(nu)x + (c + A^Tmu - nu)^Tx - b^Tmu$$
The algebra works like this: if $vX^2 + cX = -c^2/4v$ then the solution is $X = -c/2v$
you are right!!
– shineele
Dec 3 at 15:26
i still don't know how can i get $frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,i have already plug $x_i$ into $L(x,mu,v)$,but there are just lots of $x_i$
– shineele
Dec 4 at 15:02
@shineele I can't get it either, are you sure the formula for $g(mu,nu)$ is right? And did you double check the formula for $L(x,mu,nu)$? Where did this problem come from?
– Ben
Dec 4 at 16:17
yes,both of them i am sure,this problem is from Convex Optimization 5.13
– shineele
Dec 4 at 23:43
@shineele $g$ was wrong - see the new edit. A word of advice: include the source of the problem and where the solution is from when you ask such a question on here- you would get an answer much sooner this way!
– Ben
Dec 6 at 3:25
add a comment |
up vote
1
down vote
up vote
1
down vote
In terms of indices,
$$v^Tx = sumlimits_i v_ix_i, text{ and } x^Tdiag(v)x = sumlimits_i x_iv_ix_i$$
therefore their difference is $$v^Tx - x^Tdiag(v)x = sumlimits_i v_ix_i(1-x_i)$$
I suspect you have an extra "$+x^Tv$" term in $L(x,mu,nu)$ that does not belong.
Setting $L(x,mu,nu) = c^Tx + mu^T(Ax-b) - v^Tx + x^Tdiag(v)x$ we get the minimum by taking
$$dL = c^T + mu^TA - v^T + 2v^T x = 0$$
and solve that $2v^Tx = v^T - c^T - mu^TA$, in other words
$$x_i = frac1{2v_i}(v_i-c_i-sum_j mu_jA_{j,i})$$
Now plug this into $L(x,mu,nu)$ to get $g(mu,nu)$.
ADDED: Ok, the reason you aren't getting the desired solution of $g(mu,nu)$ is that it has been copied down incorrectly. The correct solution is
$$g(mu,nu) = begin{cases}-b^Tmu - (1/4)sum_{i=1}^n(c_i + a_i^Tmu - nu_i)^2/nu_i&nu geq 0\-infty&text{else}end{cases}$$
Note the placement of the square outside of the parentheses. This problem is 5.13 from Boyd's textbook, and you may check that this is the correct solution by searching for a file from Stanford's course EE364a, Winter 2007-08 titled hw5sol.pdf.
After making this change, you should check that the solution we arrived at above does give the correct answer.
Lastly, it's a little easier to check the solution if you write the Lagrangian like this:
$$L(x,mu,nu) = x^Ttext{diag}(nu)x + (c + A^Tmu - nu)^Tx - b^Tmu$$
The algebra works like this: if $vX^2 + cX = -c^2/4v$ then the solution is $X = -c/2v$
In terms of indices,
$$v^Tx = sumlimits_i v_ix_i, text{ and } x^Tdiag(v)x = sumlimits_i x_iv_ix_i$$
therefore their difference is $$v^Tx - x^Tdiag(v)x = sumlimits_i v_ix_i(1-x_i)$$
I suspect you have an extra "$+x^Tv$" term in $L(x,mu,nu)$ that does not belong.
Setting $L(x,mu,nu) = c^Tx + mu^T(Ax-b) - v^Tx + x^Tdiag(v)x$ we get the minimum by taking
$$dL = c^T + mu^TA - v^T + 2v^T x = 0$$
and solve that $2v^Tx = v^T - c^T - mu^TA$, in other words
$$x_i = frac1{2v_i}(v_i-c_i-sum_j mu_jA_{j,i})$$
Now plug this into $L(x,mu,nu)$ to get $g(mu,nu)$.
ADDED: Ok, the reason you aren't getting the desired solution of $g(mu,nu)$ is that it has been copied down incorrectly. The correct solution is
$$g(mu,nu) = begin{cases}-b^Tmu - (1/4)sum_{i=1}^n(c_i + a_i^Tmu - nu_i)^2/nu_i&nu geq 0\-infty&text{else}end{cases}$$
Note the placement of the square outside of the parentheses. This problem is 5.13 from Boyd's textbook, and you may check that this is the correct solution by searching for a file from Stanford's course EE364a, Winter 2007-08 titled hw5sol.pdf.
After making this change, you should check that the solution we arrived at above does give the correct answer.
Lastly, it's a little easier to check the solution if you write the Lagrangian like this:
$$L(x,mu,nu) = x^Ttext{diag}(nu)x + (c + A^Tmu - nu)^Tx - b^Tmu$$
The algebra works like this: if $vX^2 + cX = -c^2/4v$ then the solution is $X = -c/2v$
edited Dec 6 at 3:02
answered Dec 3 at 14:12
Ben
2,171616
2,171616
you are right!!
– shineele
Dec 3 at 15:26
i still don't know how can i get $frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,i have already plug $x_i$ into $L(x,mu,v)$,but there are just lots of $x_i$
– shineele
Dec 4 at 15:02
@shineele I can't get it either, are you sure the formula for $g(mu,nu)$ is right? And did you double check the formula for $L(x,mu,nu)$? Where did this problem come from?
– Ben
Dec 4 at 16:17
yes,both of them i am sure,this problem is from Convex Optimization 5.13
– shineele
Dec 4 at 23:43
@shineele $g$ was wrong - see the new edit. A word of advice: include the source of the problem and where the solution is from when you ask such a question on here- you would get an answer much sooner this way!
– Ben
Dec 6 at 3:25
add a comment |
you are right!!
– shineele
Dec 3 at 15:26
i still don't know how can i get $frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,i have already plug $x_i$ into $L(x,mu,v)$,but there are just lots of $x_i$
– shineele
Dec 4 at 15:02
@shineele I can't get it either, are you sure the formula for $g(mu,nu)$ is right? And did you double check the formula for $L(x,mu,nu)$? Where did this problem come from?
– Ben
Dec 4 at 16:17
yes,both of them i am sure,this problem is from Convex Optimization 5.13
– shineele
Dec 4 at 23:43
@shineele $g$ was wrong - see the new edit. A word of advice: include the source of the problem and where the solution is from when you ask such a question on here- you would get an answer much sooner this way!
– Ben
Dec 6 at 3:25
you are right!!
– shineele
Dec 3 at 15:26
you are right!!
– shineele
Dec 3 at 15:26
i still don't know how can i get $frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,i have already plug $x_i$ into $L(x,mu,v)$,but there are just lots of $x_i$
– shineele
Dec 4 at 15:02
i still don't know how can i get $frac{1}{4} sumlimits_{i=1}^{n}(frac{c_i+a_i^T mu -v_i^2}{v_i})$,i have already plug $x_i$ into $L(x,mu,v)$,but there are just lots of $x_i$
– shineele
Dec 4 at 15:02
@shineele I can't get it either, are you sure the formula for $g(mu,nu)$ is right? And did you double check the formula for $L(x,mu,nu)$? Where did this problem come from?
– Ben
Dec 4 at 16:17
@shineele I can't get it either, are you sure the formula for $g(mu,nu)$ is right? And did you double check the formula for $L(x,mu,nu)$? Where did this problem come from?
– Ben
Dec 4 at 16:17
yes,both of them i am sure,this problem is from Convex Optimization 5.13
– shineele
Dec 4 at 23:43
yes,both of them i am sure,this problem is from Convex Optimization 5.13
– shineele
Dec 4 at 23:43
@shineele $g$ was wrong - see the new edit. A word of advice: include the source of the problem and where the solution is from when you ask such a question on here- you would get an answer much sooner this way!
– Ben
Dec 6 at 3:25
@shineele $g$ was wrong - see the new edit. A word of advice: include the source of the problem and where the solution is from when you ask such a question on here- you would get an answer much sooner this way!
– Ben
Dec 6 at 3:25
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3024056%2fwhy-is-sum-limits-i-1nv-ix-i1-x-i-vtxxt-diagvx-and-its-dual-func%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown