Chain rule for partial matrix dervative.

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











up vote
0
down vote

favorite












Let $f: mathbbR^a rightarrow mathbbR$ and $z: mathbbR^b rightarrow mathbbR^a$ functions of vectors.



I know that computing the partial derivate $fracpartial fpartial x$ is computed using the chain rule
$$fracpartial fpartial x = sum_i fracpartial fpartial z_ifracpartial z_ipartial x$$



Does this generalize to matrices? That means, do I need to sum over all entries in the matrix



$$fracpartial fpartial x = sum_i,j fracpartial fpartial z_i,jfracpartial z_i,jpartial x$$



assuming $z$ and $x$ are defined on some real matrix space?







share|cite|improve this question























    up vote
    0
    down vote

    favorite












    Let $f: mathbbR^a rightarrow mathbbR$ and $z: mathbbR^b rightarrow mathbbR^a$ functions of vectors.



    I know that computing the partial derivate $fracpartial fpartial x$ is computed using the chain rule
    $$fracpartial fpartial x = sum_i fracpartial fpartial z_ifracpartial z_ipartial x$$



    Does this generalize to matrices? That means, do I need to sum over all entries in the matrix



    $$fracpartial fpartial x = sum_i,j fracpartial fpartial z_i,jfracpartial z_i,jpartial x$$



    assuming $z$ and $x$ are defined on some real matrix space?







    share|cite|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Let $f: mathbbR^a rightarrow mathbbR$ and $z: mathbbR^b rightarrow mathbbR^a$ functions of vectors.



      I know that computing the partial derivate $fracpartial fpartial x$ is computed using the chain rule
      $$fracpartial fpartial x = sum_i fracpartial fpartial z_ifracpartial z_ipartial x$$



      Does this generalize to matrices? That means, do I need to sum over all entries in the matrix



      $$fracpartial fpartial x = sum_i,j fracpartial fpartial z_i,jfracpartial z_i,jpartial x$$



      assuming $z$ and $x$ are defined on some real matrix space?







      share|cite|improve this question











      Let $f: mathbbR^a rightarrow mathbbR$ and $z: mathbbR^b rightarrow mathbbR^a$ functions of vectors.



      I know that computing the partial derivate $fracpartial fpartial x$ is computed using the chain rule
      $$fracpartial fpartial x = sum_i fracpartial fpartial z_ifracpartial z_ipartial x$$



      Does this generalize to matrices? That means, do I need to sum over all entries in the matrix



      $$fracpartial fpartial x = sum_i,j fracpartial fpartial z_i,jfracpartial z_i,jpartial x$$



      assuming $z$ and $x$ are defined on some real matrix space?









      share|cite|improve this question










      share|cite|improve this question




      share|cite|improve this question









      asked Jul 16 at 14:39









      backboltz37

      31




      31




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          There's something a little wonky with your formula. I think it should be $$fracpartial (fcirc z)partial x_k =sum_i fracpartial fpartial z_i fracpartial z_ipartial x_k$$
          To answer your question though, yes it should be the same because when we take matrix derivatives we are implicitly identifying $textMat_ntimes m(mathbbR)$ with $mathbbR^nm$ and taking the derivative in the euclidean space.






          share|cite|improve this answer




























            up vote
            0
            down vote













            Do you mean that the space $mathbb R^a$ is replaced by something like $M_n, m(mathbb R)$, the space of $n times m$ matrices with real entries? Then yes -- as far as calculus is concerned, $M_n, m(mathbb R) = mathbb R^n times m$, and you just iterate over the components of $mathbb R^n times m$, which correspond to the matrix entries of the matrices in $M_n, m(mathbb R)$.






            share|cite|improve this answer




























              up vote
              0
              down vote













              As the other answers mention, yes everything works as intended, and the reason is that in some sense you are still working within the realm of multivariate calculus. Even though everything has technically been expressed in terms of matrices, if you dive into the calculus being done then effectively the matrices just represent a fancy indexing scheme for your variables.



              Using a notation slightly more suggestive of the operations you are doing, you could even say $$fracpartial fpartial x=fracpartial fpartial zfracpartial zpartial x.$$ The product of the matrix $fracpartial fpartial z$ with the tensor $fracpartial zpartial x$ will have the intended behavior.



              If these are the kinds of questions you find yourself asking lately, I would highly recommend the Matrix Cookbook. You can buy a physical copy, or you can reference the *.pdf the authors host. They cover more kinds of vector and matrix derivatives than you can shake a stick at.






              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%2f2853471%2fchain-rule-for-partial-matrix-dervative%23new-answer', 'question_page');

                );

                Post as a guest






























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                2
                down vote



                accepted










                There's something a little wonky with your formula. I think it should be $$fracpartial (fcirc z)partial x_k =sum_i fracpartial fpartial z_i fracpartial z_ipartial x_k$$
                To answer your question though, yes it should be the same because when we take matrix derivatives we are implicitly identifying $textMat_ntimes m(mathbbR)$ with $mathbbR^nm$ and taking the derivative in the euclidean space.






                share|cite|improve this answer

























                  up vote
                  2
                  down vote



                  accepted










                  There's something a little wonky with your formula. I think it should be $$fracpartial (fcirc z)partial x_k =sum_i fracpartial fpartial z_i fracpartial z_ipartial x_k$$
                  To answer your question though, yes it should be the same because when we take matrix derivatives we are implicitly identifying $textMat_ntimes m(mathbbR)$ with $mathbbR^nm$ and taking the derivative in the euclidean space.






                  share|cite|improve this answer























                    up vote
                    2
                    down vote



                    accepted







                    up vote
                    2
                    down vote



                    accepted






                    There's something a little wonky with your formula. I think it should be $$fracpartial (fcirc z)partial x_k =sum_i fracpartial fpartial z_i fracpartial z_ipartial x_k$$
                    To answer your question though, yes it should be the same because when we take matrix derivatives we are implicitly identifying $textMat_ntimes m(mathbbR)$ with $mathbbR^nm$ and taking the derivative in the euclidean space.






                    share|cite|improve this answer













                    There's something a little wonky with your formula. I think it should be $$fracpartial (fcirc z)partial x_k =sum_i fracpartial fpartial z_i fracpartial z_ipartial x_k$$
                    To answer your question though, yes it should be the same because when we take matrix derivatives we are implicitly identifying $textMat_ntimes m(mathbbR)$ with $mathbbR^nm$ and taking the derivative in the euclidean space.







                    share|cite|improve this answer













                    share|cite|improve this answer



                    share|cite|improve this answer











                    answered Jul 16 at 14:50









                    itinerantleopard

                    1136




                    1136




















                        up vote
                        0
                        down vote













                        Do you mean that the space $mathbb R^a$ is replaced by something like $M_n, m(mathbb R)$, the space of $n times m$ matrices with real entries? Then yes -- as far as calculus is concerned, $M_n, m(mathbb R) = mathbb R^n times m$, and you just iterate over the components of $mathbb R^n times m$, which correspond to the matrix entries of the matrices in $M_n, m(mathbb R)$.






                        share|cite|improve this answer

























                          up vote
                          0
                          down vote













                          Do you mean that the space $mathbb R^a$ is replaced by something like $M_n, m(mathbb R)$, the space of $n times m$ matrices with real entries? Then yes -- as far as calculus is concerned, $M_n, m(mathbb R) = mathbb R^n times m$, and you just iterate over the components of $mathbb R^n times m$, which correspond to the matrix entries of the matrices in $M_n, m(mathbb R)$.






                          share|cite|improve this answer























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            Do you mean that the space $mathbb R^a$ is replaced by something like $M_n, m(mathbb R)$, the space of $n times m$ matrices with real entries? Then yes -- as far as calculus is concerned, $M_n, m(mathbb R) = mathbb R^n times m$, and you just iterate over the components of $mathbb R^n times m$, which correspond to the matrix entries of the matrices in $M_n, m(mathbb R)$.






                            share|cite|improve this answer













                            Do you mean that the space $mathbb R^a$ is replaced by something like $M_n, m(mathbb R)$, the space of $n times m$ matrices with real entries? Then yes -- as far as calculus is concerned, $M_n, m(mathbb R) = mathbb R^n times m$, and you just iterate over the components of $mathbb R^n times m$, which correspond to the matrix entries of the matrices in $M_n, m(mathbb R)$.







                            share|cite|improve this answer













                            share|cite|improve this answer



                            share|cite|improve this answer











                            answered Jul 16 at 14:48









                            Mees de Vries

                            13.7k12345




                            13.7k12345




















                                up vote
                                0
                                down vote













                                As the other answers mention, yes everything works as intended, and the reason is that in some sense you are still working within the realm of multivariate calculus. Even though everything has technically been expressed in terms of matrices, if you dive into the calculus being done then effectively the matrices just represent a fancy indexing scheme for your variables.



                                Using a notation slightly more suggestive of the operations you are doing, you could even say $$fracpartial fpartial x=fracpartial fpartial zfracpartial zpartial x.$$ The product of the matrix $fracpartial fpartial z$ with the tensor $fracpartial zpartial x$ will have the intended behavior.



                                If these are the kinds of questions you find yourself asking lately, I would highly recommend the Matrix Cookbook. You can buy a physical copy, or you can reference the *.pdf the authors host. They cover more kinds of vector and matrix derivatives than you can shake a stick at.






                                share|cite|improve this answer

























                                  up vote
                                  0
                                  down vote













                                  As the other answers mention, yes everything works as intended, and the reason is that in some sense you are still working within the realm of multivariate calculus. Even though everything has technically been expressed in terms of matrices, if you dive into the calculus being done then effectively the matrices just represent a fancy indexing scheme for your variables.



                                  Using a notation slightly more suggestive of the operations you are doing, you could even say $$fracpartial fpartial x=fracpartial fpartial zfracpartial zpartial x.$$ The product of the matrix $fracpartial fpartial z$ with the tensor $fracpartial zpartial x$ will have the intended behavior.



                                  If these are the kinds of questions you find yourself asking lately, I would highly recommend the Matrix Cookbook. You can buy a physical copy, or you can reference the *.pdf the authors host. They cover more kinds of vector and matrix derivatives than you can shake a stick at.






                                  share|cite|improve this answer























                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    As the other answers mention, yes everything works as intended, and the reason is that in some sense you are still working within the realm of multivariate calculus. Even though everything has technically been expressed in terms of matrices, if you dive into the calculus being done then effectively the matrices just represent a fancy indexing scheme for your variables.



                                    Using a notation slightly more suggestive of the operations you are doing, you could even say $$fracpartial fpartial x=fracpartial fpartial zfracpartial zpartial x.$$ The product of the matrix $fracpartial fpartial z$ with the tensor $fracpartial zpartial x$ will have the intended behavior.



                                    If these are the kinds of questions you find yourself asking lately, I would highly recommend the Matrix Cookbook. You can buy a physical copy, or you can reference the *.pdf the authors host. They cover more kinds of vector and matrix derivatives than you can shake a stick at.






                                    share|cite|improve this answer













                                    As the other answers mention, yes everything works as intended, and the reason is that in some sense you are still working within the realm of multivariate calculus. Even though everything has technically been expressed in terms of matrices, if you dive into the calculus being done then effectively the matrices just represent a fancy indexing scheme for your variables.



                                    Using a notation slightly more suggestive of the operations you are doing, you could even say $$fracpartial fpartial x=fracpartial fpartial zfracpartial zpartial x.$$ The product of the matrix $fracpartial fpartial z$ with the tensor $fracpartial zpartial x$ will have the intended behavior.



                                    If these are the kinds of questions you find yourself asking lately, I would highly recommend the Matrix Cookbook. You can buy a physical copy, or you can reference the *.pdf the authors host. They cover more kinds of vector and matrix derivatives than you can shake a stick at.







                                    share|cite|improve this answer













                                    share|cite|improve this answer



                                    share|cite|improve this answer











                                    answered Jul 16 at 14:57









                                    Hans Musgrave

                                    1,393111




                                    1,393111






















                                         

                                        draft saved


                                        draft discarded


























                                         


                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2853471%2fchain-rule-for-partial-matrix-dervative%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?