How to calculate the $frac{partial det(mathbf X)}{partial mathbf X}$ and $frac{partial tr(mathbf...












1












$begingroup$


How to calculate the $frac{partial det(mathbf X)}{partial mathbf X}$ and $frac{partial tr(mathbf X^n)}{partial mathbf X}$ by using Frobenius product?i tried to begin the calculation,but i stuck here at once



$ det(mathbf X)=I_{mn}:X$ and $ tr(mathbf X^n)=I_{mn}:X^n$,but i don't know how to calculate it.










share|cite|improve this question









$endgroup$

















    1












    $begingroup$


    How to calculate the $frac{partial det(mathbf X)}{partial mathbf X}$ and $frac{partial tr(mathbf X^n)}{partial mathbf X}$ by using Frobenius product?i tried to begin the calculation,but i stuck here at once



    $ det(mathbf X)=I_{mn}:X$ and $ tr(mathbf X^n)=I_{mn}:X^n$,but i don't know how to calculate it.










    share|cite|improve this question









    $endgroup$















      1












      1








      1


      2



      $begingroup$


      How to calculate the $frac{partial det(mathbf X)}{partial mathbf X}$ and $frac{partial tr(mathbf X^n)}{partial mathbf X}$ by using Frobenius product?i tried to begin the calculation,but i stuck here at once



      $ det(mathbf X)=I_{mn}:X$ and $ tr(mathbf X^n)=I_{mn}:X^n$,but i don't know how to calculate it.










      share|cite|improve this question









      $endgroup$




      How to calculate the $frac{partial det(mathbf X)}{partial mathbf X}$ and $frac{partial tr(mathbf X^n)}{partial mathbf X}$ by using Frobenius product?i tried to begin the calculation,but i stuck here at once



      $ det(mathbf X)=I_{mn}:X$ and $ tr(mathbf X^n)=I_{mn}:X^n$,but i don't know how to calculate it.







      matrices partial-derivative frobenius-method






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Dec 1 '18 at 7:46









      shineeleshineele

      377




      377






















          1 Answer
          1






          active

          oldest

          votes


















          1












          $begingroup$

          Let's start by finding the gradient of a small concrete example.
          $$eqalign{
          phi &= {rm tr}(X^3) = I:X^3 cr
          dphi
          &= I:(dX,X,X+X,dX,X+X,X,dX) cr
          &= X^TX^T:dX + X^TX^T:dX + X^TX^T:dX cr
          &= (3X^2)^T:dX cr
          frac{partialphi}{partial X} &= (3X^{2})^T cr
          }$$

          This can be immediately extended to higher powers and scalar coefficients.
          $$eqalign{
          phi &= {rm tr}(alpha X^k) cr
          dphi &= (nalpha X^{k-1})^T:dX cr
          frac{partialphi}{partial X} &= (kalpha X^{k-1})^T cr
          }$$

          Then extended again to any function expressed as a power series.
          $$eqalign{
          F &= sum_kalpha_kX^k implies
          F' &= sum_kkalpha_kX^{k-1} cr
          phi &= {rm tr}(F) cr
          dphi &= (F')^T:dX cr
          frac{partialphi}{partial X} &= (F')^T crcr
          }$$

          To handle the determinant, consider the following
          $$eqalign{
          exp({rm tr}(X)) &=
          expBig(sum_klambda_kBig) =
          prod_kexp(lambda_k) =
          det(exp(X)) cr
          {rm tr}(X) &= log(det(exp(X))) cr
          }$$

          Now assume $X=log(Y)$ in which case $Y=exp(X)$ and
          $$
          {rm tr}(log(Y)) = log(det(Y))
          $$

          This allows us to use the above trace-trick to find the gradient of
          $$eqalign{
          phi &= log(det(X)) = {rm tr}(log(X)) cr
          dphi &= (X^{-1})^T:dX cr
          frac{partialphi}{partial X} &= (X^{-1})^T cr
          }$$

          To find the gradient of the determinant, note that the preceding was a logarithmic derivative, so
          $$eqalign{
          frac{partialphi}{partial X}
          &= frac{tfrac{partial,det(X)}{partial X}}{det(X)} cr
          frac{partial,det(X)}{partial X} &= det(X),(X^{-1})^T cr
          }$$






          share|cite|improve this answer











          $endgroup$













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


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3021097%2fhow-to-calculate-the-frac-partial-det-mathbf-x-partial-mathbf-x-and%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









            1












            $begingroup$

            Let's start by finding the gradient of a small concrete example.
            $$eqalign{
            phi &= {rm tr}(X^3) = I:X^3 cr
            dphi
            &= I:(dX,X,X+X,dX,X+X,X,dX) cr
            &= X^TX^T:dX + X^TX^T:dX + X^TX^T:dX cr
            &= (3X^2)^T:dX cr
            frac{partialphi}{partial X} &= (3X^{2})^T cr
            }$$

            This can be immediately extended to higher powers and scalar coefficients.
            $$eqalign{
            phi &= {rm tr}(alpha X^k) cr
            dphi &= (nalpha X^{k-1})^T:dX cr
            frac{partialphi}{partial X} &= (kalpha X^{k-1})^T cr
            }$$

            Then extended again to any function expressed as a power series.
            $$eqalign{
            F &= sum_kalpha_kX^k implies
            F' &= sum_kkalpha_kX^{k-1} cr
            phi &= {rm tr}(F) cr
            dphi &= (F')^T:dX cr
            frac{partialphi}{partial X} &= (F')^T crcr
            }$$

            To handle the determinant, consider the following
            $$eqalign{
            exp({rm tr}(X)) &=
            expBig(sum_klambda_kBig) =
            prod_kexp(lambda_k) =
            det(exp(X)) cr
            {rm tr}(X) &= log(det(exp(X))) cr
            }$$

            Now assume $X=log(Y)$ in which case $Y=exp(X)$ and
            $$
            {rm tr}(log(Y)) = log(det(Y))
            $$

            This allows us to use the above trace-trick to find the gradient of
            $$eqalign{
            phi &= log(det(X)) = {rm tr}(log(X)) cr
            dphi &= (X^{-1})^T:dX cr
            frac{partialphi}{partial X} &= (X^{-1})^T cr
            }$$

            To find the gradient of the determinant, note that the preceding was a logarithmic derivative, so
            $$eqalign{
            frac{partialphi}{partial X}
            &= frac{tfrac{partial,det(X)}{partial X}}{det(X)} cr
            frac{partial,det(X)}{partial X} &= det(X),(X^{-1})^T cr
            }$$






            share|cite|improve this answer











            $endgroup$


















              1












              $begingroup$

              Let's start by finding the gradient of a small concrete example.
              $$eqalign{
              phi &= {rm tr}(X^3) = I:X^3 cr
              dphi
              &= I:(dX,X,X+X,dX,X+X,X,dX) cr
              &= X^TX^T:dX + X^TX^T:dX + X^TX^T:dX cr
              &= (3X^2)^T:dX cr
              frac{partialphi}{partial X} &= (3X^{2})^T cr
              }$$

              This can be immediately extended to higher powers and scalar coefficients.
              $$eqalign{
              phi &= {rm tr}(alpha X^k) cr
              dphi &= (nalpha X^{k-1})^T:dX cr
              frac{partialphi}{partial X} &= (kalpha X^{k-1})^T cr
              }$$

              Then extended again to any function expressed as a power series.
              $$eqalign{
              F &= sum_kalpha_kX^k implies
              F' &= sum_kkalpha_kX^{k-1} cr
              phi &= {rm tr}(F) cr
              dphi &= (F')^T:dX cr
              frac{partialphi}{partial X} &= (F')^T crcr
              }$$

              To handle the determinant, consider the following
              $$eqalign{
              exp({rm tr}(X)) &=
              expBig(sum_klambda_kBig) =
              prod_kexp(lambda_k) =
              det(exp(X)) cr
              {rm tr}(X) &= log(det(exp(X))) cr
              }$$

              Now assume $X=log(Y)$ in which case $Y=exp(X)$ and
              $$
              {rm tr}(log(Y)) = log(det(Y))
              $$

              This allows us to use the above trace-trick to find the gradient of
              $$eqalign{
              phi &= log(det(X)) = {rm tr}(log(X)) cr
              dphi &= (X^{-1})^T:dX cr
              frac{partialphi}{partial X} &= (X^{-1})^T cr
              }$$

              To find the gradient of the determinant, note that the preceding was a logarithmic derivative, so
              $$eqalign{
              frac{partialphi}{partial X}
              &= frac{tfrac{partial,det(X)}{partial X}}{det(X)} cr
              frac{partial,det(X)}{partial X} &= det(X),(X^{-1})^T cr
              }$$






              share|cite|improve this answer











              $endgroup$
















                1












                1








                1





                $begingroup$

                Let's start by finding the gradient of a small concrete example.
                $$eqalign{
                phi &= {rm tr}(X^3) = I:X^3 cr
                dphi
                &= I:(dX,X,X+X,dX,X+X,X,dX) cr
                &= X^TX^T:dX + X^TX^T:dX + X^TX^T:dX cr
                &= (3X^2)^T:dX cr
                frac{partialphi}{partial X} &= (3X^{2})^T cr
                }$$

                This can be immediately extended to higher powers and scalar coefficients.
                $$eqalign{
                phi &= {rm tr}(alpha X^k) cr
                dphi &= (nalpha X^{k-1})^T:dX cr
                frac{partialphi}{partial X} &= (kalpha X^{k-1})^T cr
                }$$

                Then extended again to any function expressed as a power series.
                $$eqalign{
                F &= sum_kalpha_kX^k implies
                F' &= sum_kkalpha_kX^{k-1} cr
                phi &= {rm tr}(F) cr
                dphi &= (F')^T:dX cr
                frac{partialphi}{partial X} &= (F')^T crcr
                }$$

                To handle the determinant, consider the following
                $$eqalign{
                exp({rm tr}(X)) &=
                expBig(sum_klambda_kBig) =
                prod_kexp(lambda_k) =
                det(exp(X)) cr
                {rm tr}(X) &= log(det(exp(X))) cr
                }$$

                Now assume $X=log(Y)$ in which case $Y=exp(X)$ and
                $$
                {rm tr}(log(Y)) = log(det(Y))
                $$

                This allows us to use the above trace-trick to find the gradient of
                $$eqalign{
                phi &= log(det(X)) = {rm tr}(log(X)) cr
                dphi &= (X^{-1})^T:dX cr
                frac{partialphi}{partial X} &= (X^{-1})^T cr
                }$$

                To find the gradient of the determinant, note that the preceding was a logarithmic derivative, so
                $$eqalign{
                frac{partialphi}{partial X}
                &= frac{tfrac{partial,det(X)}{partial X}}{det(X)} cr
                frac{partial,det(X)}{partial X} &= det(X),(X^{-1})^T cr
                }$$






                share|cite|improve this answer











                $endgroup$



                Let's start by finding the gradient of a small concrete example.
                $$eqalign{
                phi &= {rm tr}(X^3) = I:X^3 cr
                dphi
                &= I:(dX,X,X+X,dX,X+X,X,dX) cr
                &= X^TX^T:dX + X^TX^T:dX + X^TX^T:dX cr
                &= (3X^2)^T:dX cr
                frac{partialphi}{partial X} &= (3X^{2})^T cr
                }$$

                This can be immediately extended to higher powers and scalar coefficients.
                $$eqalign{
                phi &= {rm tr}(alpha X^k) cr
                dphi &= (nalpha X^{k-1})^T:dX cr
                frac{partialphi}{partial X} &= (kalpha X^{k-1})^T cr
                }$$

                Then extended again to any function expressed as a power series.
                $$eqalign{
                F &= sum_kalpha_kX^k implies
                F' &= sum_kkalpha_kX^{k-1} cr
                phi &= {rm tr}(F) cr
                dphi &= (F')^T:dX cr
                frac{partialphi}{partial X} &= (F')^T crcr
                }$$

                To handle the determinant, consider the following
                $$eqalign{
                exp({rm tr}(X)) &=
                expBig(sum_klambda_kBig) =
                prod_kexp(lambda_k) =
                det(exp(X)) cr
                {rm tr}(X) &= log(det(exp(X))) cr
                }$$

                Now assume $X=log(Y)$ in which case $Y=exp(X)$ and
                $$
                {rm tr}(log(Y)) = log(det(Y))
                $$

                This allows us to use the above trace-trick to find the gradient of
                $$eqalign{
                phi &= log(det(X)) = {rm tr}(log(X)) cr
                dphi &= (X^{-1})^T:dX cr
                frac{partialphi}{partial X} &= (X^{-1})^T cr
                }$$

                To find the gradient of the determinant, note that the preceding was a logarithmic derivative, so
                $$eqalign{
                frac{partialphi}{partial X}
                &= frac{tfrac{partial,det(X)}{partial X}}{det(X)} cr
                frac{partial,det(X)}{partial X} &= det(X),(X^{-1})^T cr
                }$$







                share|cite|improve this answer














                share|cite|improve this answer



                share|cite|improve this answer








                edited Dec 1 '18 at 18:03

























                answered Dec 1 '18 at 17:37









                lynnlynn

                1,766177




                1,766177






























                    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%2f3021097%2fhow-to-calculate-the-frac-partial-det-mathbf-x-partial-mathbf-x-and%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

                    Quarter-circle Tiles

                    build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

                    Mont Emei