Gradient of a function with integral

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Let $mathbfx$ be a $ntimes 1$ vector. Let $mu(mathbfx)$ and $sigma(mathbfx)$ be scalar functions of $mathbfx$. What is the derivative of the following function w.r.to $mathbfx$ $$f(mathbfx)=int_-infty^0 exp(-frac(z-mu(mathbfx))^2sigma^2(mathbfx))dz$$







share|cite|improve this question















  • 1




    What have you done so far?
    – Kavi Rama Murthy
    Aug 3 at 11:45










  • I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
    – dineshdileep
    Aug 3 at 12:02














up vote
0
down vote

favorite












Let $mathbfx$ be a $ntimes 1$ vector. Let $mu(mathbfx)$ and $sigma(mathbfx)$ be scalar functions of $mathbfx$. What is the derivative of the following function w.r.to $mathbfx$ $$f(mathbfx)=int_-infty^0 exp(-frac(z-mu(mathbfx))^2sigma^2(mathbfx))dz$$







share|cite|improve this question















  • 1




    What have you done so far?
    – Kavi Rama Murthy
    Aug 3 at 11:45










  • I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
    – dineshdileep
    Aug 3 at 12:02












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Let $mathbfx$ be a $ntimes 1$ vector. Let $mu(mathbfx)$ and $sigma(mathbfx)$ be scalar functions of $mathbfx$. What is the derivative of the following function w.r.to $mathbfx$ $$f(mathbfx)=int_-infty^0 exp(-frac(z-mu(mathbfx))^2sigma^2(mathbfx))dz$$







share|cite|improve this question











Let $mathbfx$ be a $ntimes 1$ vector. Let $mu(mathbfx)$ and $sigma(mathbfx)$ be scalar functions of $mathbfx$. What is the derivative of the following function w.r.to $mathbfx$ $$f(mathbfx)=int_-infty^0 exp(-frac(z-mu(mathbfx))^2sigma^2(mathbfx))dz$$









share|cite|improve this question










share|cite|improve this question




share|cite|improve this question









asked Aug 3 at 11:36









dineshdileep

5,67711434




5,67711434







  • 1




    What have you done so far?
    – Kavi Rama Murthy
    Aug 3 at 11:45










  • I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
    – dineshdileep
    Aug 3 at 12:02












  • 1




    What have you done so far?
    – Kavi Rama Murthy
    Aug 3 at 11:45










  • I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
    – dineshdileep
    Aug 3 at 12:02







1




1




What have you done so far?
– Kavi Rama Murthy
Aug 3 at 11:45




What have you done so far?
– Kavi Rama Murthy
Aug 3 at 11:45












I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
– dineshdileep
Aug 3 at 12:02




I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
– dineshdileep
Aug 3 at 12:02










2 Answers
2






active

oldest

votes

















up vote
0
down vote













For simplicity, let the function in the exponential be $Gamma(z, vecx)$ and the function under the integral $f(z, vecx)$. The function in question is integrable for every $vecx$. $\$
The partial derivative with respect to $x_i$ of your function:
$$ partial_x_i = exp (Gamma(z, vecx) cdot partial_x_iGamma(z, vecx) = f(z, vecx) cdot partial_x_iGamma(z, vecx) $$
Since we're integrating on a different variable than any $x_i$, if the above is integrable over the same domain then you can switch derivatives and integrals, which means that the $i$-th component of the gradient:
$$nabla_i int_infty^0 f(z, vecx) dz = int_infty^0 f(z, vecx) cdot partial_x_iGamma(z, vecx) dz $$
I believe one can find the final expression from here. I'll fill in the final details as soon as I have a piece of paper to sketch the final result.






share|cite|improve this answer




























    up vote
    0
    down vote













    $$nabla_x f(x) = int_-infty^0nabla_x exp(-frac(z-mu(x))^2sigma(x)^2) dz \= int_-infty^0 exp(-frac(z-mu(x))^2sigma(x)^2) left[2frac(z-mu(x))nabla_x musigma(x)^2 +2 frac(z-mu(x))^2nabla_xsigmasigma(x)^3right]dz$$.



    The first part, $propto nabla_xmu$, you may easily integrate by taking $nabla_xmu$ out of the integral and realizing



    $$
    2frac(z-mu(x))sigma(x)^2 = partial_z frac(z-mu(x))^2sigma(x)^2
    $$



    The second part has no closed form and may only be expressed in term of error-functions (as one may calculate by using the product rule und definition of $erf$):
    $$
    int x^2 exp(-x^2)dx = frac14(sqrtpierf(x)-2exp(-x^2)x) + C
    $$






    share|cite|improve this answer























      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',
      convertImagesToLinks: true,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      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%2f2870975%2fgradient-of-a-function-with-integral%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      For simplicity, let the function in the exponential be $Gamma(z, vecx)$ and the function under the integral $f(z, vecx)$. The function in question is integrable for every $vecx$. $\$
      The partial derivative with respect to $x_i$ of your function:
      $$ partial_x_i = exp (Gamma(z, vecx) cdot partial_x_iGamma(z, vecx) = f(z, vecx) cdot partial_x_iGamma(z, vecx) $$
      Since we're integrating on a different variable than any $x_i$, if the above is integrable over the same domain then you can switch derivatives and integrals, which means that the $i$-th component of the gradient:
      $$nabla_i int_infty^0 f(z, vecx) dz = int_infty^0 f(z, vecx) cdot partial_x_iGamma(z, vecx) dz $$
      I believe one can find the final expression from here. I'll fill in the final details as soon as I have a piece of paper to sketch the final result.






      share|cite|improve this answer

























        up vote
        0
        down vote













        For simplicity, let the function in the exponential be $Gamma(z, vecx)$ and the function under the integral $f(z, vecx)$. The function in question is integrable for every $vecx$. $\$
        The partial derivative with respect to $x_i$ of your function:
        $$ partial_x_i = exp (Gamma(z, vecx) cdot partial_x_iGamma(z, vecx) = f(z, vecx) cdot partial_x_iGamma(z, vecx) $$
        Since we're integrating on a different variable than any $x_i$, if the above is integrable over the same domain then you can switch derivatives and integrals, which means that the $i$-th component of the gradient:
        $$nabla_i int_infty^0 f(z, vecx) dz = int_infty^0 f(z, vecx) cdot partial_x_iGamma(z, vecx) dz $$
        I believe one can find the final expression from here. I'll fill in the final details as soon as I have a piece of paper to sketch the final result.






        share|cite|improve this answer























          up vote
          0
          down vote










          up vote
          0
          down vote









          For simplicity, let the function in the exponential be $Gamma(z, vecx)$ and the function under the integral $f(z, vecx)$. The function in question is integrable for every $vecx$. $\$
          The partial derivative with respect to $x_i$ of your function:
          $$ partial_x_i = exp (Gamma(z, vecx) cdot partial_x_iGamma(z, vecx) = f(z, vecx) cdot partial_x_iGamma(z, vecx) $$
          Since we're integrating on a different variable than any $x_i$, if the above is integrable over the same domain then you can switch derivatives and integrals, which means that the $i$-th component of the gradient:
          $$nabla_i int_infty^0 f(z, vecx) dz = int_infty^0 f(z, vecx) cdot partial_x_iGamma(z, vecx) dz $$
          I believe one can find the final expression from here. I'll fill in the final details as soon as I have a piece of paper to sketch the final result.






          share|cite|improve this answer













          For simplicity, let the function in the exponential be $Gamma(z, vecx)$ and the function under the integral $f(z, vecx)$. The function in question is integrable for every $vecx$. $\$
          The partial derivative with respect to $x_i$ of your function:
          $$ partial_x_i = exp (Gamma(z, vecx) cdot partial_x_iGamma(z, vecx) = f(z, vecx) cdot partial_x_iGamma(z, vecx) $$
          Since we're integrating on a different variable than any $x_i$, if the above is integrable over the same domain then you can switch derivatives and integrals, which means that the $i$-th component of the gradient:
          $$nabla_i int_infty^0 f(z, vecx) dz = int_infty^0 f(z, vecx) cdot partial_x_iGamma(z, vecx) dz $$
          I believe one can find the final expression from here. I'll fill in the final details as soon as I have a piece of paper to sketch the final result.







          share|cite|improve this answer













          share|cite|improve this answer



          share|cite|improve this answer











          answered Aug 3 at 13:33









          Niki Di Giano

          650211




          650211




















              up vote
              0
              down vote













              $$nabla_x f(x) = int_-infty^0nabla_x exp(-frac(z-mu(x))^2sigma(x)^2) dz \= int_-infty^0 exp(-frac(z-mu(x))^2sigma(x)^2) left[2frac(z-mu(x))nabla_x musigma(x)^2 +2 frac(z-mu(x))^2nabla_xsigmasigma(x)^3right]dz$$.



              The first part, $propto nabla_xmu$, you may easily integrate by taking $nabla_xmu$ out of the integral and realizing



              $$
              2frac(z-mu(x))sigma(x)^2 = partial_z frac(z-mu(x))^2sigma(x)^2
              $$



              The second part has no closed form and may only be expressed in term of error-functions (as one may calculate by using the product rule und definition of $erf$):
              $$
              int x^2 exp(-x^2)dx = frac14(sqrtpierf(x)-2exp(-x^2)x) + C
              $$






              share|cite|improve this answer



























                up vote
                0
                down vote













                $$nabla_x f(x) = int_-infty^0nabla_x exp(-frac(z-mu(x))^2sigma(x)^2) dz \= int_-infty^0 exp(-frac(z-mu(x))^2sigma(x)^2) left[2frac(z-mu(x))nabla_x musigma(x)^2 +2 frac(z-mu(x))^2nabla_xsigmasigma(x)^3right]dz$$.



                The first part, $propto nabla_xmu$, you may easily integrate by taking $nabla_xmu$ out of the integral and realizing



                $$
                2frac(z-mu(x))sigma(x)^2 = partial_z frac(z-mu(x))^2sigma(x)^2
                $$



                The second part has no closed form and may only be expressed in term of error-functions (as one may calculate by using the product rule und definition of $erf$):
                $$
                int x^2 exp(-x^2)dx = frac14(sqrtpierf(x)-2exp(-x^2)x) + C
                $$






                share|cite|improve this answer

























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  $$nabla_x f(x) = int_-infty^0nabla_x exp(-frac(z-mu(x))^2sigma(x)^2) dz \= int_-infty^0 exp(-frac(z-mu(x))^2sigma(x)^2) left[2frac(z-mu(x))nabla_x musigma(x)^2 +2 frac(z-mu(x))^2nabla_xsigmasigma(x)^3right]dz$$.



                  The first part, $propto nabla_xmu$, you may easily integrate by taking $nabla_xmu$ out of the integral and realizing



                  $$
                  2frac(z-mu(x))sigma(x)^2 = partial_z frac(z-mu(x))^2sigma(x)^2
                  $$



                  The second part has no closed form and may only be expressed in term of error-functions (as one may calculate by using the product rule und definition of $erf$):
                  $$
                  int x^2 exp(-x^2)dx = frac14(sqrtpierf(x)-2exp(-x^2)x) + C
                  $$






                  share|cite|improve this answer















                  $$nabla_x f(x) = int_-infty^0nabla_x exp(-frac(z-mu(x))^2sigma(x)^2) dz \= int_-infty^0 exp(-frac(z-mu(x))^2sigma(x)^2) left[2frac(z-mu(x))nabla_x musigma(x)^2 +2 frac(z-mu(x))^2nabla_xsigmasigma(x)^3right]dz$$.



                  The first part, $propto nabla_xmu$, you may easily integrate by taking $nabla_xmu$ out of the integral and realizing



                  $$
                  2frac(z-mu(x))sigma(x)^2 = partial_z frac(z-mu(x))^2sigma(x)^2
                  $$



                  The second part has no closed form and may only be expressed in term of error-functions (as one may calculate by using the product rule und definition of $erf$):
                  $$
                  int x^2 exp(-x^2)dx = frac14(sqrtpierf(x)-2exp(-x^2)x) + C
                  $$







                  share|cite|improve this answer















                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited Aug 3 at 13:59


























                  answered Aug 3 at 13:53









                  denklo

                  913




                  913






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2870975%2fgradient-of-a-function-with-integral%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      What is the equation of a 3D cone with generalised tilt?

                      Color the edges and diagonals of a regular polygon

                      Relationship between determinant of matrix and determinant of adjoint?