How to calculate the $frac{partial det(mathbf X)}{partial mathbf X}$ and $frac{partial tr(mathbf...
$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.
matrices partial-derivative frobenius-method
$endgroup$
add a comment |
$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.
matrices partial-derivative frobenius-method
$endgroup$
add a comment |
$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.
matrices partial-derivative frobenius-method
$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
matrices partial-derivative frobenius-method
asked Dec 1 '18 at 7:46
shineeleshineele
377
377
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$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
}$$
$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%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
$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
}$$
$endgroup$
add a comment |
$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
}$$
$endgroup$
add a comment |
$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
}$$
$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
}$$
edited Dec 1 '18 at 18:03
answered Dec 1 '18 at 17:37
lynnlynn
1,766177
1,766177
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%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
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