Logistic Regression is convex proof
I am trying to make sense of this paper qwone.com/~jason/writing/convexLR.pdf
"Regularized Logistic Regression is Strictly Convex" by Jason D. M. Rennie.
I am following the proof and formula (1) is a given:
$$
-ln(P(vec{y}mid X,vec{w})) = sum_{i=1}^N ln(1+e^{(-y_{i}vec{w}^Tvec{x}_i)}
$$
Assuming:
$$
g(z) = frac{1}{1+e^{-z}}
$$
I also see how
$$
1-g(z) = frac{e^{-z}}{1+e^{-z}}
$$
However, I don't follow how
$$
frac{partial g(z)}{partial z} = -g(z)(1-g(z))
$$
If I differentiate g(z) w.r.t. z I get:
$$
frac{partial g(z)}{partial z} = frac{e^{-z}}{(1+e^{-z})^2}
$$
which is $g(z)(1-g(z))$ not $-g(z)(1-g(z))$
Also, when doing (2) I get the negative of what is expressed there (taking into account it is performing the partial differential of - L.H.S. of (1)):
$$
frac{partial (-text{L.H.S. (1)} )}{partial w_j}
$$
Thanks in advance!
convex-optimization
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I am trying to make sense of this paper qwone.com/~jason/writing/convexLR.pdf
"Regularized Logistic Regression is Strictly Convex" by Jason D. M. Rennie.
I am following the proof and formula (1) is a given:
$$
-ln(P(vec{y}mid X,vec{w})) = sum_{i=1}^N ln(1+e^{(-y_{i}vec{w}^Tvec{x}_i)}
$$
Assuming:
$$
g(z) = frac{1}{1+e^{-z}}
$$
I also see how
$$
1-g(z) = frac{e^{-z}}{1+e^{-z}}
$$
However, I don't follow how
$$
frac{partial g(z)}{partial z} = -g(z)(1-g(z))
$$
If I differentiate g(z) w.r.t. z I get:
$$
frac{partial g(z)}{partial z} = frac{e^{-z}}{(1+e^{-z})^2}
$$
which is $g(z)(1-g(z))$ not $-g(z)(1-g(z))$
Also, when doing (2) I get the negative of what is expressed there (taking into account it is performing the partial differential of - L.H.S. of (1)):
$$
frac{partial (-text{L.H.S. (1)} )}{partial w_j}
$$
Thanks in advance!
convex-optimization
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
your calculations are correct, not the paper you were reading.
– Math-fun
Feb 21 '15 at 17:22
1
Someone else can check? I have seen other successful proofs that Logistic Regression optimization is a convex problem, I'm just wondering if there is anything I'm not seeing...
– user1064285
Feb 22 '15 at 14:29
add a comment |
I am trying to make sense of this paper qwone.com/~jason/writing/convexLR.pdf
"Regularized Logistic Regression is Strictly Convex" by Jason D. M. Rennie.
I am following the proof and formula (1) is a given:
$$
-ln(P(vec{y}mid X,vec{w})) = sum_{i=1}^N ln(1+e^{(-y_{i}vec{w}^Tvec{x}_i)}
$$
Assuming:
$$
g(z) = frac{1}{1+e^{-z}}
$$
I also see how
$$
1-g(z) = frac{e^{-z}}{1+e^{-z}}
$$
However, I don't follow how
$$
frac{partial g(z)}{partial z} = -g(z)(1-g(z))
$$
If I differentiate g(z) w.r.t. z I get:
$$
frac{partial g(z)}{partial z} = frac{e^{-z}}{(1+e^{-z})^2}
$$
which is $g(z)(1-g(z))$ not $-g(z)(1-g(z))$
Also, when doing (2) I get the negative of what is expressed there (taking into account it is performing the partial differential of - L.H.S. of (1)):
$$
frac{partial (-text{L.H.S. (1)} )}{partial w_j}
$$
Thanks in advance!
convex-optimization
I am trying to make sense of this paper qwone.com/~jason/writing/convexLR.pdf
"Regularized Logistic Regression is Strictly Convex" by Jason D. M. Rennie.
I am following the proof and formula (1) is a given:
$$
-ln(P(vec{y}mid X,vec{w})) = sum_{i=1}^N ln(1+e^{(-y_{i}vec{w}^Tvec{x}_i)}
$$
Assuming:
$$
g(z) = frac{1}{1+e^{-z}}
$$
I also see how
$$
1-g(z) = frac{e^{-z}}{1+e^{-z}}
$$
However, I don't follow how
$$
frac{partial g(z)}{partial z} = -g(z)(1-g(z))
$$
If I differentiate g(z) w.r.t. z I get:
$$
frac{partial g(z)}{partial z} = frac{e^{-z}}{(1+e^{-z})^2}
$$
which is $g(z)(1-g(z))$ not $-g(z)(1-g(z))$
Also, when doing (2) I get the negative of what is expressed there (taking into account it is performing the partial differential of - L.H.S. of (1)):
$$
frac{partial (-text{L.H.S. (1)} )}{partial w_j}
$$
Thanks in advance!
convex-optimization
convex-optimization
edited Feb 21 '15 at 17:16
Michael Hardy
1
1
asked Feb 21 '15 at 17:14
user1064285
334
334
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
your calculations are correct, not the paper you were reading.
– Math-fun
Feb 21 '15 at 17:22
1
Someone else can check? I have seen other successful proofs that Logistic Regression optimization is a convex problem, I'm just wondering if there is anything I'm not seeing...
– user1064285
Feb 22 '15 at 14:29
add a comment |
your calculations are correct, not the paper you were reading.
– Math-fun
Feb 21 '15 at 17:22
1
Someone else can check? I have seen other successful proofs that Logistic Regression optimization is a convex problem, I'm just wondering if there is anything I'm not seeing...
– user1064285
Feb 22 '15 at 14:29
your calculations are correct, not the paper you were reading.
– Math-fun
Feb 21 '15 at 17:22
your calculations are correct, not the paper you were reading.
– Math-fun
Feb 21 '15 at 17:22
1
1
Someone else can check? I have seen other successful proofs that Logistic Regression optimization is a convex problem, I'm just wondering if there is anything I'm not seeing...
– user1064285
Feb 22 '15 at 14:29
Someone else can check? I have seen other successful proofs that Logistic Regression optimization is a convex problem, I'm just wondering if there is anything I'm not seeing...
– user1064285
Feb 22 '15 at 14:29
add a comment |
1 Answer
1
active
oldest
votes
Here is the graph of $displaystyle g(z)=frac{1}{1+e^{-z}}$:
which is clearly increasing, hence the derivative should be positive and as your calculations show $g'(z)=g(z)(1-g(z))>0$. This could be a typo in the paper you mentioned. Further equation (2) in the "paper" is correct since it is the derivative of $displaystylelog P(.)$ not $displaystyle-log P(.)$. The second derivative in the paper is also correct.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f1159033%2flogistic-regression-is-convex-proof%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here is the graph of $displaystyle g(z)=frac{1}{1+e^{-z}}$:
which is clearly increasing, hence the derivative should be positive and as your calculations show $g'(z)=g(z)(1-g(z))>0$. This could be a typo in the paper you mentioned. Further equation (2) in the "paper" is correct since it is the derivative of $displaystylelog P(.)$ not $displaystyle-log P(.)$. The second derivative in the paper is also correct.
add a comment |
Here is the graph of $displaystyle g(z)=frac{1}{1+e^{-z}}$:
which is clearly increasing, hence the derivative should be positive and as your calculations show $g'(z)=g(z)(1-g(z))>0$. This could be a typo in the paper you mentioned. Further equation (2) in the "paper" is correct since it is the derivative of $displaystylelog P(.)$ not $displaystyle-log P(.)$. The second derivative in the paper is also correct.
add a comment |
Here is the graph of $displaystyle g(z)=frac{1}{1+e^{-z}}$:
which is clearly increasing, hence the derivative should be positive and as your calculations show $g'(z)=g(z)(1-g(z))>0$. This could be a typo in the paper you mentioned. Further equation (2) in the "paper" is correct since it is the derivative of $displaystylelog P(.)$ not $displaystyle-log P(.)$. The second derivative in the paper is also correct.
Here is the graph of $displaystyle g(z)=frac{1}{1+e^{-z}}$:
which is clearly increasing, hence the derivative should be positive and as your calculations show $g'(z)=g(z)(1-g(z))>0$. This could be a typo in the paper you mentioned. Further equation (2) in the "paper" is correct since it is the derivative of $displaystylelog P(.)$ not $displaystyle-log P(.)$. The second derivative in the paper is also correct.
answered Feb 22 '15 at 15:45
Math-fun
7,0061425
7,0061425
add a comment |
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%2f1159033%2flogistic-regression-is-convex-proof%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
your calculations are correct, not the paper you were reading.
– Math-fun
Feb 21 '15 at 17:22
1
Someone else can check? I have seen other successful proofs that Logistic Regression optimization is a convex problem, I'm just wondering if there is anything I'm not seeing...
– user1064285
Feb 22 '15 at 14:29