gradient for sum on 100 variables analytically












0












$begingroup$


I need to minimize a function with x in $R^{100}$ and $a_i$ is a given vector.



The function itself is:
$sum_{i=1}^{500} log(1- a_i^t x) - sum_{i=1}^{100} log(1-x_i^2) $



The first thing I thought about was to separate the sums:
$sum_{i=1}^{500} log(1- a_i^t x)$



Then remove the sum and do derivative of $log(1- a_i^t x)$ then add the sum back to it. Same thing is done for the other sum.



At the end I got:



$sum_{i=1}^{500} frac {- a_i^t }{ln10(1 - a_i^tx)} - sum_{i=1}^{100} frac{-2x_i}{ln10(1-x_i^2)} $



You can see the whole opration on the picture I attached.



How I got this derivative



My questions is that now I calculated the derivative with respect to x which is in $R^{100}$



I researched the gradient and watched a few videos about it , it looks something like :



grad = $$
begin{matrix}
df(x,y,z)/dx \
df(x,y,z)/dy \
df(x,y,z)/dz \
end{matrix}
$$



However, with the work I previously did I am very confused now. How do I get the gradient in this case?










share|cite|improve this question











$endgroup$












  • $begingroup$
    $x$ is a vector. This is not Calc I, where you just differentiate with respect to it. You need to differentiate with respect to each of the $x_j$ that make up $x$ instead.
    $endgroup$
    – Paul Sinclair
    Feb 2 at 20:18


















0












$begingroup$


I need to minimize a function with x in $R^{100}$ and $a_i$ is a given vector.



The function itself is:
$sum_{i=1}^{500} log(1- a_i^t x) - sum_{i=1}^{100} log(1-x_i^2) $



The first thing I thought about was to separate the sums:
$sum_{i=1}^{500} log(1- a_i^t x)$



Then remove the sum and do derivative of $log(1- a_i^t x)$ then add the sum back to it. Same thing is done for the other sum.



At the end I got:



$sum_{i=1}^{500} frac {- a_i^t }{ln10(1 - a_i^tx)} - sum_{i=1}^{100} frac{-2x_i}{ln10(1-x_i^2)} $



You can see the whole opration on the picture I attached.



How I got this derivative



My questions is that now I calculated the derivative with respect to x which is in $R^{100}$



I researched the gradient and watched a few videos about it , it looks something like :



grad = $$
begin{matrix}
df(x,y,z)/dx \
df(x,y,z)/dy \
df(x,y,z)/dz \
end{matrix}
$$



However, with the work I previously did I am very confused now. How do I get the gradient in this case?










share|cite|improve this question











$endgroup$












  • $begingroup$
    $x$ is a vector. This is not Calc I, where you just differentiate with respect to it. You need to differentiate with respect to each of the $x_j$ that make up $x$ instead.
    $endgroup$
    – Paul Sinclair
    Feb 2 at 20:18
















0












0








0





$begingroup$


I need to minimize a function with x in $R^{100}$ and $a_i$ is a given vector.



The function itself is:
$sum_{i=1}^{500} log(1- a_i^t x) - sum_{i=1}^{100} log(1-x_i^2) $



The first thing I thought about was to separate the sums:
$sum_{i=1}^{500} log(1- a_i^t x)$



Then remove the sum and do derivative of $log(1- a_i^t x)$ then add the sum back to it. Same thing is done for the other sum.



At the end I got:



$sum_{i=1}^{500} frac {- a_i^t }{ln10(1 - a_i^tx)} - sum_{i=1}^{100} frac{-2x_i}{ln10(1-x_i^2)} $



You can see the whole opration on the picture I attached.



How I got this derivative



My questions is that now I calculated the derivative with respect to x which is in $R^{100}$



I researched the gradient and watched a few videos about it , it looks something like :



grad = $$
begin{matrix}
df(x,y,z)/dx \
df(x,y,z)/dy \
df(x,y,z)/dz \
end{matrix}
$$



However, with the work I previously did I am very confused now. How do I get the gradient in this case?










share|cite|improve this question











$endgroup$




I need to minimize a function with x in $R^{100}$ and $a_i$ is a given vector.



The function itself is:
$sum_{i=1}^{500} log(1- a_i^t x) - sum_{i=1}^{100} log(1-x_i^2) $



The first thing I thought about was to separate the sums:
$sum_{i=1}^{500} log(1- a_i^t x)$



Then remove the sum and do derivative of $log(1- a_i^t x)$ then add the sum back to it. Same thing is done for the other sum.



At the end I got:



$sum_{i=1}^{500} frac {- a_i^t }{ln10(1 - a_i^tx)} - sum_{i=1}^{100} frac{-2x_i}{ln10(1-x_i^2)} $



You can see the whole opration on the picture I attached.



How I got this derivative



My questions is that now I calculated the derivative with respect to x which is in $R^{100}$



I researched the gradient and watched a few videos about it , it looks something like :



grad = $$
begin{matrix}
df(x,y,z)/dx \
df(x,y,z)/dy \
df(x,y,z)/dz \
end{matrix}
$$



However, with the work I previously did I am very confused now. How do I get the gradient in this case?







multivariable-calculus gradient-descent






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Feb 2 at 20:42







Sara Kat

















asked Feb 2 at 9:40









Sara KatSara Kat

203




203












  • $begingroup$
    $x$ is a vector. This is not Calc I, where you just differentiate with respect to it. You need to differentiate with respect to each of the $x_j$ that make up $x$ instead.
    $endgroup$
    – Paul Sinclair
    Feb 2 at 20:18




















  • $begingroup$
    $x$ is a vector. This is not Calc I, where you just differentiate with respect to it. You need to differentiate with respect to each of the $x_j$ that make up $x$ instead.
    $endgroup$
    – Paul Sinclair
    Feb 2 at 20:18


















$begingroup$
$x$ is a vector. This is not Calc I, where you just differentiate with respect to it. You need to differentiate with respect to each of the $x_j$ that make up $x$ instead.
$endgroup$
– Paul Sinclair
Feb 2 at 20:18






$begingroup$
$x$ is a vector. This is not Calc I, where you just differentiate with respect to it. You need to differentiate with respect to each of the $x_j$ that make up $x$ instead.
$endgroup$
– Paul Sinclair
Feb 2 at 20:18












0






active

oldest

votes












Your Answer








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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3097149%2fgradient-for-sum-on-100-variables-analytically%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3097149%2fgradient-for-sum-on-100-variables-analytically%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

Npm cannot find a required file even through it is in the searched directory