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
$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.
matrices partial-derivative matrix-equations matrix-calculus
$endgroup$
add a comment |
$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.
matrices partial-derivative matrix-equations matrix-calculus
$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
add a comment |
$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.
matrices partial-derivative matrix-equations matrix-calculus
$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
matrices partial-derivative matrix-equations matrix-calculus
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
add a comment |
$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
add a comment |
1 Answer
1
active
oldest
votes
$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
$$
$endgroup$
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
$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
$$
$endgroup$
add a comment |
$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
$$
$endgroup$
add a comment |
$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
$$
$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
$$
edited Mar 30 at 23:11
answered Mar 30 at 22:51
greggreg
9,3361825
9,3361825
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
$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