Partial derivative of matrix The 2019 Stack Overflow Developer Survey Results Are InScalar-by-matrix Derivative of Quadratic ProductDerivative of determinant of symmetric matrix wrt a scalarPartial derivative of the trace of matrix entry-wise exponential?Derivative of a function with respect to a matrixMatrix derivative of a special functionDerivative with respect to entries of a matrixHow can I calculate the partial derivative $fracpartialpartial vecx fleft(Avecx + vecbright)$ using matrix calculus?Matrix derivative of transposeDerivative with respect to diagonal of diagonal matrixPartial Derivative of Trace of Matrix in negative power wrt to parameters

Can an undergraduate be advised by a professor who is very far away?

How to translate "being like"?

What is the meaning of Triage in Cybersec world?

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

How much of the clove should I use when using big garlic heads?

APIPA and LAN Broadcast Domain

Why doesn't UInt have a toDouble()?

Loose spokes after only a few rides

Are spiders unable to hurt humans, especially very small spiders?

Output the Arecibo Message

What is the most efficient way to store a numeric range?

How do I free up internal storage if I don't have any apps downloaded?

What do hard-Brexiteers want with respect to the Irish border?

Does adding complexity mean a more secure cipher?

Why “相同意思的词” is called “同义词” instead of "同意词"?

How to notate time signature switching consistently every measure

Correct punctuation for showing a character's confusion

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

Is it a good practice to use a static variable in a Test Class and use that in the actual class instead of Test.isRunningTest()?

Relationship between Gromov-Witten and Taubes' Gromov invariant

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?

I am an eight letter word. What am I?

Is bread bad for ducks?

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?



Partial derivative of matrix



The 2019 Stack Overflow Developer Survey Results Are InScalar-by-matrix Derivative of Quadratic ProductDerivative of determinant of symmetric matrix wrt a scalarPartial derivative of the trace of matrix entry-wise exponential?Derivative of a function with respect to a matrixMatrix derivative of a special functionDerivative with respect to entries of a matrixHow can I calculate the partial derivative $fracpartialpartial vecx fleft(Avecx + vecbright)$ using matrix calculus?Matrix derivative of transposeDerivative with respect to diagonal of diagonal matrixPartial Derivative of Trace of Matrix in negative power wrt to parameters










0












$begingroup$


$renewcommandv[1]mathrmvecleft(#1right)
renewcommandm[1]mathbf#1
renewcommandtrace[1]mathrmtraceleft(#1right)
renewcommanddiag[1]mathrmdiagleft(#1right)$



Suppose we have the diagonal matrix $mathbfD = Diag(mathbf1^TmathbfH)$, $1$ is a column vector with ones.



How can we calculate the partial derivative of the following wrt matrix calculus? ($A$ is known matrix.) $$fracpartial ( mathbf D^-1 mathbf A)partialm H$$



Since now, I have reached the following using matrix cookbook:



$$fracpartial ( mathbf D^-1 mathbf A)partialm H = -mathbfA mathbfD^-1
fracpartial mathbf Dpartialm H mathbfD^-1 = -mathbfA mathbfD^-1
mathbf1^T mathbfJ mathbfD^-1 $$



I think I am missing something with 1 and J.










share|cite|improve this question











$endgroup$











  • $begingroup$
    What is $H$ in the line $Diag(1^TH)$? Or is it meant to be $A$?
    $endgroup$
    – user1936752
    Mar 20 at 13:11











  • $begingroup$
    H is the uknown matrix. That's why the partial derivative is wrt H. And D is basically a diagonal matrix with its diagonal entries be the sum of each column of H. (that's what $mathbf1^T$ does).
    $endgroup$
    – OliveR
    Mar 20 at 19:51
















0












$begingroup$


$renewcommandv[1]mathrmvecleft(#1right)
renewcommandm[1]mathbf#1
renewcommandtrace[1]mathrmtraceleft(#1right)
renewcommanddiag[1]mathrmdiagleft(#1right)$



Suppose we have the diagonal matrix $mathbfD = Diag(mathbf1^TmathbfH)$, $1$ is a column vector with ones.



How can we calculate the partial derivative of the following wrt matrix calculus? ($A$ is known matrix.) $$fracpartial ( mathbf D^-1 mathbf A)partialm H$$



Since now, I have reached the following using matrix cookbook:



$$fracpartial ( mathbf D^-1 mathbf A)partialm H = -mathbfA mathbfD^-1
fracpartial mathbf Dpartialm H mathbfD^-1 = -mathbfA mathbfD^-1
mathbf1^T mathbfJ mathbfD^-1 $$



I think I am missing something with 1 and J.










share|cite|improve this question











$endgroup$











  • $begingroup$
    What is $H$ in the line $Diag(1^TH)$? Or is it meant to be $A$?
    $endgroup$
    – user1936752
    Mar 20 at 13:11











  • $begingroup$
    H is the uknown matrix. That's why the partial derivative is wrt H. And D is basically a diagonal matrix with its diagonal entries be the sum of each column of H. (that's what $mathbf1^T$ does).
    $endgroup$
    – OliveR
    Mar 20 at 19:51














0












0








0





$begingroup$


$renewcommandv[1]mathrmvecleft(#1right)
renewcommandm[1]mathbf#1
renewcommandtrace[1]mathrmtraceleft(#1right)
renewcommanddiag[1]mathrmdiagleft(#1right)$



Suppose we have the diagonal matrix $mathbfD = Diag(mathbf1^TmathbfH)$, $1$ is a column vector with ones.



How can we calculate the partial derivative of the following wrt matrix calculus? ($A$ is known matrix.) $$fracpartial ( mathbf D^-1 mathbf A)partialm H$$



Since now, I have reached the following using matrix cookbook:



$$fracpartial ( mathbf D^-1 mathbf A)partialm H = -mathbfA mathbfD^-1
fracpartial mathbf Dpartialm H mathbfD^-1 = -mathbfA mathbfD^-1
mathbf1^T mathbfJ mathbfD^-1 $$



I think I am missing something with 1 and J.










share|cite|improve this question











$endgroup$




$renewcommandv[1]mathrmvecleft(#1right)
renewcommandm[1]mathbf#1
renewcommandtrace[1]mathrmtraceleft(#1right)
renewcommanddiag[1]mathrmdiagleft(#1right)$



Suppose we have the diagonal matrix $mathbfD = Diag(mathbf1^TmathbfH)$, $1$ is a column vector with ones.



How can we calculate the partial derivative of the following wrt matrix calculus? ($A$ is known matrix.) $$fracpartial ( mathbf D^-1 mathbf A)partialm H$$



Since now, I have reached the following using matrix cookbook:



$$fracpartial ( mathbf D^-1 mathbf A)partialm H = -mathbfA mathbfD^-1
fracpartial mathbf Dpartialm H mathbfD^-1 = -mathbfA mathbfD^-1
mathbf1^T mathbfJ mathbfD^-1 $$



I think I am missing something with 1 and J.







matrices partial-derivative matrix-equations matrix-calculus






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 20 at 19:54







OliveR

















asked Mar 20 at 11:30









OliveROliveR

255




255











  • $begingroup$
    What is $H$ in the line $Diag(1^TH)$? Or is it meant to be $A$?
    $endgroup$
    – user1936752
    Mar 20 at 13:11











  • $begingroup$
    H is the uknown matrix. That's why the partial derivative is wrt H. And D is basically a diagonal matrix with its diagonal entries be the sum of each column of H. (that's what $mathbf1^T$ does).
    $endgroup$
    – OliveR
    Mar 20 at 19:51

















  • $begingroup$
    What is $H$ in the line $Diag(1^TH)$? Or is it meant to be $A$?
    $endgroup$
    – user1936752
    Mar 20 at 13:11











  • $begingroup$
    H is the uknown matrix. That's why the partial derivative is wrt H. And D is basically a diagonal matrix with its diagonal entries be the sum of each column of H. (that's what $mathbf1^T$ does).
    $endgroup$
    – OliveR
    Mar 20 at 19:51
















$begingroup$
What is $H$ in the line $Diag(1^TH)$? Or is it meant to be $A$?
$endgroup$
– user1936752
Mar 20 at 13:11





$begingroup$
What is $H$ in the line $Diag(1^TH)$? Or is it meant to be $A$?
$endgroup$
– user1936752
Mar 20 at 13:11













$begingroup$
H is the uknown matrix. That's why the partial derivative is wrt H. And D is basically a diagonal matrix with its diagonal entries be the sum of each column of H. (that's what $mathbf1^T$ does).
$endgroup$
– OliveR
Mar 20 at 19:51





$begingroup$
H is the uknown matrix. That's why the partial derivative is wrt H. And D is basically a diagonal matrix with its diagonal entries be the sum of each column of H. (that's what $mathbf1^T$ does).
$endgroup$
– OliveR
Mar 20 at 19:51











1 Answer
1






active

oldest

votes


















2












$begingroup$

Specify the dimensions of all the vectors and matrices involved.
$$eqalign
A & &in mathbb R^ntimes p cr
H & &in mathbb R^mtimes n cr
h &= rm vec(H) &in mathbb R^mntimes 1 cr
v &= H^T1_m &in mathbb R^ntimes 1 cr
L &= (I_notimes 1_n)odot(1_notimes I_n) &in mathbb R^n^2times n cr
B &= rm Diag(v) &in mathbb R^ntimes n cr
b &= rm vec(B) = Lv &in mathbb R^n^2times 1 cr
&= LH^T1_m cr
&= rm vec(1_m^THL^T) cr
&= (Lotimes 1_m^T),h cr
$$

where $I_n$ is the $ntimes n$ identity matrix, $1_n$ is the all-ones vector of length $n$, $odot$ is the Hadamard product, and $otimes$ is the Kronecker product.



The function of interest is matrix-valued, so it must be flattened/vectorized in order to express the resulting derivative as a matrix (instead of a fourth-order tensor).



The steps are to calculate the function differential, vectorize it, and formulate the matrix derivative.
$$eqalign
F &= B^-1Acr
dF &= -B^-1,dB,B^-1A cr
&= -B^-1,dB,F cr
rm vec(dF) &= -(F^Totimes B^-1),rm vec(dB) cr
df
&= -(F^Totimes B^-1),db cr
&= -(F^Totimes B^-1),(Lotimes 1_m^T),dh cr
fracpartial fpartial h
&= -(F^Totimes B^-1),(Lotimes 1_m^T)
&= fracpartial ,rm vec(F)partial ,rm vec(H) 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%2f3155318%2fpartial-derivative-of-matrix%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









    2












    $begingroup$

    Specify the dimensions of all the vectors and matrices involved.
    $$eqalign
    A & &in mathbb R^ntimes p cr
    H & &in mathbb R^mtimes n cr
    h &= rm vec(H) &in mathbb R^mntimes 1 cr
    v &= H^T1_m &in mathbb R^ntimes 1 cr
    L &= (I_notimes 1_n)odot(1_notimes I_n) &in mathbb R^n^2times n cr
    B &= rm Diag(v) &in mathbb R^ntimes n cr
    b &= rm vec(B) = Lv &in mathbb R^n^2times 1 cr
    &= LH^T1_m cr
    &= rm vec(1_m^THL^T) cr
    &= (Lotimes 1_m^T),h cr
    $$

    where $I_n$ is the $ntimes n$ identity matrix, $1_n$ is the all-ones vector of length $n$, $odot$ is the Hadamard product, and $otimes$ is the Kronecker product.



    The function of interest is matrix-valued, so it must be flattened/vectorized in order to express the resulting derivative as a matrix (instead of a fourth-order tensor).



    The steps are to calculate the function differential, vectorize it, and formulate the matrix derivative.
    $$eqalign
    F &= B^-1Acr
    dF &= -B^-1,dB,B^-1A cr
    &= -B^-1,dB,F cr
    rm vec(dF) &= -(F^Totimes B^-1),rm vec(dB) cr
    df
    &= -(F^Totimes B^-1),db cr
    &= -(F^Totimes B^-1),(Lotimes 1_m^T),dh cr
    fracpartial fpartial h
    &= -(F^Totimes B^-1),(Lotimes 1_m^T)
    &= fracpartial ,rm vec(F)partial ,rm vec(H) cr
    $$






    share|cite|improve this answer











    $endgroup$

















      2












      $begingroup$

      Specify the dimensions of all the vectors and matrices involved.
      $$eqalign
      A & &in mathbb R^ntimes p cr
      H & &in mathbb R^mtimes n cr
      h &= rm vec(H) &in mathbb R^mntimes 1 cr
      v &= H^T1_m &in mathbb R^ntimes 1 cr
      L &= (I_notimes 1_n)odot(1_notimes I_n) &in mathbb R^n^2times n cr
      B &= rm Diag(v) &in mathbb R^ntimes n cr
      b &= rm vec(B) = Lv &in mathbb R^n^2times 1 cr
      &= LH^T1_m cr
      &= rm vec(1_m^THL^T) cr
      &= (Lotimes 1_m^T),h cr
      $$

      where $I_n$ is the $ntimes n$ identity matrix, $1_n$ is the all-ones vector of length $n$, $odot$ is the Hadamard product, and $otimes$ is the Kronecker product.



      The function of interest is matrix-valued, so it must be flattened/vectorized in order to express the resulting derivative as a matrix (instead of a fourth-order tensor).



      The steps are to calculate the function differential, vectorize it, and formulate the matrix derivative.
      $$eqalign
      F &= B^-1Acr
      dF &= -B^-1,dB,B^-1A cr
      &= -B^-1,dB,F cr
      rm vec(dF) &= -(F^Totimes B^-1),rm vec(dB) cr
      df
      &= -(F^Totimes B^-1),db cr
      &= -(F^Totimes B^-1),(Lotimes 1_m^T),dh cr
      fracpartial fpartial h
      &= -(F^Totimes B^-1),(Lotimes 1_m^T)
      &= fracpartial ,rm vec(F)partial ,rm vec(H) cr
      $$






      share|cite|improve this answer











      $endgroup$















        2












        2








        2





        $begingroup$

        Specify the dimensions of all the vectors and matrices involved.
        $$eqalign
        A & &in mathbb R^ntimes p cr
        H & &in mathbb R^mtimes n cr
        h &= rm vec(H) &in mathbb R^mntimes 1 cr
        v &= H^T1_m &in mathbb R^ntimes 1 cr
        L &= (I_notimes 1_n)odot(1_notimes I_n) &in mathbb R^n^2times n cr
        B &= rm Diag(v) &in mathbb R^ntimes n cr
        b &= rm vec(B) = Lv &in mathbb R^n^2times 1 cr
        &= LH^T1_m cr
        &= rm vec(1_m^THL^T) cr
        &= (Lotimes 1_m^T),h cr
        $$

        where $I_n$ is the $ntimes n$ identity matrix, $1_n$ is the all-ones vector of length $n$, $odot$ is the Hadamard product, and $otimes$ is the Kronecker product.



        The function of interest is matrix-valued, so it must be flattened/vectorized in order to express the resulting derivative as a matrix (instead of a fourth-order tensor).



        The steps are to calculate the function differential, vectorize it, and formulate the matrix derivative.
        $$eqalign
        F &= B^-1Acr
        dF &= -B^-1,dB,B^-1A cr
        &= -B^-1,dB,F cr
        rm vec(dF) &= -(F^Totimes B^-1),rm vec(dB) cr
        df
        &= -(F^Totimes B^-1),db cr
        &= -(F^Totimes B^-1),(Lotimes 1_m^T),dh cr
        fracpartial fpartial h
        &= -(F^Totimes B^-1),(Lotimes 1_m^T)
        &= fracpartial ,rm vec(F)partial ,rm vec(H) cr
        $$






        share|cite|improve this answer











        $endgroup$



        Specify the dimensions of all the vectors and matrices involved.
        $$eqalign
        A & &in mathbb R^ntimes p cr
        H & &in mathbb R^mtimes n cr
        h &= rm vec(H) &in mathbb R^mntimes 1 cr
        v &= H^T1_m &in mathbb R^ntimes 1 cr
        L &= (I_notimes 1_n)odot(1_notimes I_n) &in mathbb R^n^2times n cr
        B &= rm Diag(v) &in mathbb R^ntimes n cr
        b &= rm vec(B) = Lv &in mathbb R^n^2times 1 cr
        &= LH^T1_m cr
        &= rm vec(1_m^THL^T) cr
        &= (Lotimes 1_m^T),h cr
        $$

        where $I_n$ is the $ntimes n$ identity matrix, $1_n$ is the all-ones vector of length $n$, $odot$ is the Hadamard product, and $otimes$ is the Kronecker product.



        The function of interest is matrix-valued, so it must be flattened/vectorized in order to express the resulting derivative as a matrix (instead of a fourth-order tensor).



        The steps are to calculate the function differential, vectorize it, and formulate the matrix derivative.
        $$eqalign
        F &= B^-1Acr
        dF &= -B^-1,dB,B^-1A cr
        &= -B^-1,dB,F cr
        rm vec(dF) &= -(F^Totimes B^-1),rm vec(dB) cr
        df
        &= -(F^Totimes B^-1),db cr
        &= -(F^Totimes B^-1),(Lotimes 1_m^T),dh cr
        fracpartial fpartial h
        &= -(F^Totimes B^-1),(Lotimes 1_m^T)
        &= fracpartial ,rm vec(F)partial ,rm vec(H) cr
        $$







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Mar 30 at 23:11

























        answered Mar 30 at 22:51









        greggreg

        9,3361825




        9,3361825



























            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%2f3155318%2fpartial-derivative-of-matrix%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

            Triangular numbers and gcdProving sum of a set is $0 pmod n$ if $n$ is odd, or $fracn2 pmod n$ if $n$ is even?Is greatest common divisor of two numbers really their smallest linear combination?GCD, LCM RelationshipProve a set of nonnegative integers with greatest common divisor 1 and closed under addition has all but finite many nonnegative integers.all pairs of a and b in an equation containing gcdTriangular Numbers Modulo $k$ - Hit All Values?Understanding the Existence and Uniqueness of the GCDGCD and LCM with logical symbolsThe greatest common divisor of two positive integers less than 100 is equal to 3. Their least common multiple is twelve times one of the integers.Suppose that for all integers $x$, $x|a$ and $x|b$ if and only if $x|c$. Then $c = gcd(a,b)$Which is the gcd of 2 numbers which are multiplied and the result is 600000?

            Ingelân Ynhâld Etymology | Geografy | Skiednis | Polityk en bestjoer | Ekonomy | Demografy | Kultuer | Klimaat | Sjoch ek | Keppelings om utens | Boarnen, noaten en referinsjes Navigaasjemenuwww.gov.ukOffisjele webside fan it regear fan it Feriene KeninkrykOffisjele webside fan it Britske FerkearsburoNederlânsktalige ynformaasje fan it Britske FerkearsburoOffisjele webside fan English Heritage, de organisaasje dy't him ynset foar it behâld fan it Ingelske kultuergoedYnwennertallen fan alle Britske stêden út 'e folkstelling fan 2011Notes en References, op dizze sideEngland

            Հադիս Բովանդակություն Անվանում և նշանակություն | Դասակարգում | Աղբյուրներ | Նավարկման ցանկ