Derivative of a matrix using Kronecker product

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











up vote
1
down vote

favorite
1












I have this Equation (1) and I want derivative in respect to $underline s $:
$$diag(underline s)times C times diag(underline s)$$
that $underline s $ is a $n times 1$ vector and $C$ is an $n times n$ matrix. If I open up the Equation, I can find derivative but I would like to find it with Kronecker product. I tried and reach to this:
$$ ( E_j^T otimes E_i^T )vec(underline s otimes I + I otimes underline s) $$
that $ E_j $ is all zeros matrix except (j,j) element that is one. actually, I replaced derivative and vec operator because for its linearity. anyone can help me to devectorizing this or Find derivative in another way? Is it correct to displacement of vec and derivation?
thanks.










share|cite|improve this question























  • You might have better luck with elementwise/Hadamard $odot$ products rather than Kronecker $otimes$ products. $$eqalignF&=rm Diag(s)cdot Ccdotrm Diag(s)=Codot ss^Tcr dF&=Codot(s,ds^T+ds,s^T)$$
    – greg
    Sep 10 at 16:49














up vote
1
down vote

favorite
1












I have this Equation (1) and I want derivative in respect to $underline s $:
$$diag(underline s)times C times diag(underline s)$$
that $underline s $ is a $n times 1$ vector and $C$ is an $n times n$ matrix. If I open up the Equation, I can find derivative but I would like to find it with Kronecker product. I tried and reach to this:
$$ ( E_j^T otimes E_i^T )vec(underline s otimes I + I otimes underline s) $$
that $ E_j $ is all zeros matrix except (j,j) element that is one. actually, I replaced derivative and vec operator because for its linearity. anyone can help me to devectorizing this or Find derivative in another way? Is it correct to displacement of vec and derivation?
thanks.










share|cite|improve this question























  • You might have better luck with elementwise/Hadamard $odot$ products rather than Kronecker $otimes$ products. $$eqalignF&=rm Diag(s)cdot Ccdotrm Diag(s)=Codot ss^Tcr dF&=Codot(s,ds^T+ds,s^T)$$
    – greg
    Sep 10 at 16:49












up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I have this Equation (1) and I want derivative in respect to $underline s $:
$$diag(underline s)times C times diag(underline s)$$
that $underline s $ is a $n times 1$ vector and $C$ is an $n times n$ matrix. If I open up the Equation, I can find derivative but I would like to find it with Kronecker product. I tried and reach to this:
$$ ( E_j^T otimes E_i^T )vec(underline s otimes I + I otimes underline s) $$
that $ E_j $ is all zeros matrix except (j,j) element that is one. actually, I replaced derivative and vec operator because for its linearity. anyone can help me to devectorizing this or Find derivative in another way? Is it correct to displacement of vec and derivation?
thanks.










share|cite|improve this question















I have this Equation (1) and I want derivative in respect to $underline s $:
$$diag(underline s)times C times diag(underline s)$$
that $underline s $ is a $n times 1$ vector and $C$ is an $n times n$ matrix. If I open up the Equation, I can find derivative but I would like to find it with Kronecker product. I tried and reach to this:
$$ ( E_j^T otimes E_i^T )vec(underline s otimes I + I otimes underline s) $$
that $ E_j $ is all zeros matrix except (j,j) element that is one. actually, I replaced derivative and vec operator because for its linearity. anyone can help me to devectorizing this or Find derivative in another way? Is it correct to displacement of vec and derivation?
thanks.







derivatives matrix-calculus kronecker-product






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Sep 10 at 11:28

























asked Sep 10 at 8:38









Alireza Pourafzal

85




85











  • You might have better luck with elementwise/Hadamard $odot$ products rather than Kronecker $otimes$ products. $$eqalignF&=rm Diag(s)cdot Ccdotrm Diag(s)=Codot ss^Tcr dF&=Codot(s,ds^T+ds,s^T)$$
    – greg
    Sep 10 at 16:49
















  • You might have better luck with elementwise/Hadamard $odot$ products rather than Kronecker $otimes$ products. $$eqalignF&=rm Diag(s)cdot Ccdotrm Diag(s)=Codot ss^Tcr dF&=Codot(s,ds^T+ds,s^T)$$
    – greg
    Sep 10 at 16:49















You might have better luck with elementwise/Hadamard $odot$ products rather than Kronecker $otimes$ products. $$eqalignF&=rm Diag(s)cdot Ccdotrm Diag(s)=Codot ss^Tcr dF&=Codot(s,ds^T+ds,s^T)$$
– greg
Sep 10 at 16:49




You might have better luck with elementwise/Hadamard $odot$ products rather than Kronecker $otimes$ products. $$eqalignF&=rm Diag(s)cdot Ccdotrm Diag(s)=Codot ss^Tcr dF&=Codot(s,ds^T+ds,s^T)$$
– greg
Sep 10 at 16:49










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










To combine your approach with the one in my comment...



First write the function and its differential using a Hadamard product
$$eqalign
F &= rm Diag(s),C,rm Diag(s) = Codot ss^T cr
dF &= Codot ds,s^T + Codot s,ds^T cr
$$
Define the diagonal matrix $$D_c=rm Diagbig(rm vec(C)big)$$
and use it to vectorize the differential
$$eqalign
df
&= D_c,rm vec(ds,s^T) + D_c,rm vec(s,ds^T) cr
&= D_c,(sotimes I),ds + D_c,(Iotimes s),ds cr
&= D_c,big(sotimes I + Iotimes sbig),dscr
$$
Yielding the gradient of the vectorized function as
$$fracpartial fpartial s = D_c,big(sotimes I + Iotimes sbig)$$






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%2f2911682%2fderivative-of-a-matrix-using-kronecker-product%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote



    accepted










    To combine your approach with the one in my comment...



    First write the function and its differential using a Hadamard product
    $$eqalign
    F &= rm Diag(s),C,rm Diag(s) = Codot ss^T cr
    dF &= Codot ds,s^T + Codot s,ds^T cr
    $$
    Define the diagonal matrix $$D_c=rm Diagbig(rm vec(C)big)$$
    and use it to vectorize the differential
    $$eqalign
    df
    &= D_c,rm vec(ds,s^T) + D_c,rm vec(s,ds^T) cr
    &= D_c,(sotimes I),ds + D_c,(Iotimes s),ds cr
    &= D_c,big(sotimes I + Iotimes sbig),dscr
    $$
    Yielding the gradient of the vectorized function as
    $$fracpartial fpartial s = D_c,big(sotimes I + Iotimes sbig)$$






    share|cite|improve this answer


























      up vote
      3
      down vote



      accepted










      To combine your approach with the one in my comment...



      First write the function and its differential using a Hadamard product
      $$eqalign
      F &= rm Diag(s),C,rm Diag(s) = Codot ss^T cr
      dF &= Codot ds,s^T + Codot s,ds^T cr
      $$
      Define the diagonal matrix $$D_c=rm Diagbig(rm vec(C)big)$$
      and use it to vectorize the differential
      $$eqalign
      df
      &= D_c,rm vec(ds,s^T) + D_c,rm vec(s,ds^T) cr
      &= D_c,(sotimes I),ds + D_c,(Iotimes s),ds cr
      &= D_c,big(sotimes I + Iotimes sbig),dscr
      $$
      Yielding the gradient of the vectorized function as
      $$fracpartial fpartial s = D_c,big(sotimes I + Iotimes sbig)$$






      share|cite|improve this answer
























        up vote
        3
        down vote



        accepted







        up vote
        3
        down vote



        accepted






        To combine your approach with the one in my comment...



        First write the function and its differential using a Hadamard product
        $$eqalign
        F &= rm Diag(s),C,rm Diag(s) = Codot ss^T cr
        dF &= Codot ds,s^T + Codot s,ds^T cr
        $$
        Define the diagonal matrix $$D_c=rm Diagbig(rm vec(C)big)$$
        and use it to vectorize the differential
        $$eqalign
        df
        &= D_c,rm vec(ds,s^T) + D_c,rm vec(s,ds^T) cr
        &= D_c,(sotimes I),ds + D_c,(Iotimes s),ds cr
        &= D_c,big(sotimes I + Iotimes sbig),dscr
        $$
        Yielding the gradient of the vectorized function as
        $$fracpartial fpartial s = D_c,big(sotimes I + Iotimes sbig)$$






        share|cite|improve this answer














        To combine your approach with the one in my comment...



        First write the function and its differential using a Hadamard product
        $$eqalign
        F &= rm Diag(s),C,rm Diag(s) = Codot ss^T cr
        dF &= Codot ds,s^T + Codot s,ds^T cr
        $$
        Define the diagonal matrix $$D_c=rm Diagbig(rm vec(C)big)$$
        and use it to vectorize the differential
        $$eqalign
        df
        &= D_c,rm vec(ds,s^T) + D_c,rm vec(s,ds^T) cr
        &= D_c,(sotimes I),ds + D_c,(Iotimes s),ds cr
        &= D_c,big(sotimes I + Iotimes sbig),dscr
        $$
        Yielding the gradient of the vectorized function as
        $$fracpartial fpartial s = D_c,big(sotimes I + Iotimes sbig)$$







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Sep 10 at 20:52

























        answered Sep 10 at 20:19









        greg

        6,1781717




        6,1781717



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2911682%2fderivative-of-a-matrix-using-kronecker-product%23new-answer', 'question_page');

            );

            Post as a guest













































































            這個網誌中的熱門文章

            Why am i infinitely getting the same tweet with the Twitter Search API?

            Is there any way to eliminate the singular point to solve this integral by hand or by approximations?

            Strongly p-embedded subgroups and p-Sylow subgroups.