How can I calculate the partial derivative $fracpartialpartial vecx fleft(Avecx + vecbright)$ using matrix calculus?How to transform between two layout forms of matrix calculus?How can I differentiate the following using Matrix Calculus?How can I optimise a scalar function over a matrix?How do I deal with this Diag operator when differentiating with respect to a matrix?Matrix calculus: Show that $fracpartial A thetapartial theta=A^T$Partial derivative of a function with respect to a MatrixMatrix Differentiation of Fraction PowerHow to take partial derivative of a matrix with respect to another matrixWhy is $fracpartial operatornameTr(mathbf X^n)partial mathbf X=nleft(mathbf X^n-1right)^T ?$How to find $fracpartialpartial mathbfQleft(x_2^intercal (mathbfI_Totimes mathbfQ)^-1x_2right)$?
Is it a bad idea to plug the other end of ESD strap to wall ground?
Finding the reason behind the value of the integral.
How to travel to Japan while expressing milk?
Is it "common practice in Fourier transform spectroscopy to multiply the measured interferogram by an apodizing function"? If so, why?
Finitely generated matrix groups whose eigenvalues are all algebraic
Why do I get negative height?
ssTTsSTtRrriinInnnnNNNIiinngg
Implication of namely
How do conventional missiles fly?
Does the Idaho Potato Commission associate potato skins with healthy eating?
How obscure is the use of 令 in 令和?
Mathematica command that allows it to read my intentions
Can a virus destroy the BIOS of a modern computer?
Why were 5.25" floppy drives cheaper than 8"?
How to show a landlord what we have in savings?
How can saying a song's name be a copyright violation?
Why is the sentence "Das ist eine Nase" correct?
Can someone clarify Hamming's notion of important problems in relation to modern academia?
Does Dispel Magic work on Tiny Hut?
How to Prove P(a) → ∀x(P(x) ∨ ¬(x = a)) using Natural Deduction
Processor speed limited at 0.4 Ghz
Theorists sure want true answers to this!
How exploitable/balanced is this homebrew spell: Spell Permanency?
How do I exit BASH while loop using modulus operator?
How can I calculate the partial derivative $fracpartialpartial vecx fleft(Avecx + vecbright)$ using matrix calculus?
How to transform between two layout forms of matrix calculus?How can I differentiate the following using Matrix Calculus?How can I optimise a scalar function over a matrix?How do I deal with this Diag operator when differentiating with respect to a matrix?Matrix calculus: Show that $fracpartial A thetapartial theta=A^T$Partial derivative of a function with respect to a MatrixMatrix Differentiation of Fraction PowerHow to take partial derivative of a matrix with respect to another matrixWhy is $fracpartial operatornameTr(mathbf X^n)partial mathbf X=nleft(mathbf X^n-1right)^T ?$How to find $fracpartialpartial mathbfQleft(x_2^intercal (mathbfI_Totimes mathbfQ)^-1x_2right)$?
$begingroup$
I want to calculate $fracpartialpartial vecx fleft(Avecx + vecbright)$ where $vecx, vecb in mathbbR^n$ and $f: mathbbR^n rightarrow mathbbR^n$ which is applied element-wise. Is it correct that since both $vecx$ and $fleft(Avecx + vecbright)$ are vectors the partial derivative must be a Jacobian matrix? I tried applying the chain rule and various identities I have found on Wikipedia, but I am very unsure about the result:
$$fracpartialpartial vecx fleft(Avecx + vecbright) = fracpartialpartial vecx left(Avecx + vecbright)operatornamediagleft(f'left(Avecx + vecbright)right) = Aoperatornamediagleft(f'left(Avecx + vecbright)right)$$
matrix-calculus
$endgroup$
add a comment |
$begingroup$
I want to calculate $fracpartialpartial vecx fleft(Avecx + vecbright)$ where $vecx, vecb in mathbbR^n$ and $f: mathbbR^n rightarrow mathbbR^n$ which is applied element-wise. Is it correct that since both $vecx$ and $fleft(Avecx + vecbright)$ are vectors the partial derivative must be a Jacobian matrix? I tried applying the chain rule and various identities I have found on Wikipedia, but I am very unsure about the result:
$$fracpartialpartial vecx fleft(Avecx + vecbright) = fracpartialpartial vecx left(Avecx + vecbright)operatornamediagleft(f'left(Avecx + vecbright)right) = Aoperatornamediagleft(f'left(Avecx + vecbright)right)$$
matrix-calculus
$endgroup$
add a comment |
$begingroup$
I want to calculate $fracpartialpartial vecx fleft(Avecx + vecbright)$ where $vecx, vecb in mathbbR^n$ and $f: mathbbR^n rightarrow mathbbR^n$ which is applied element-wise. Is it correct that since both $vecx$ and $fleft(Avecx + vecbright)$ are vectors the partial derivative must be a Jacobian matrix? I tried applying the chain rule and various identities I have found on Wikipedia, but I am very unsure about the result:
$$fracpartialpartial vecx fleft(Avecx + vecbright) = fracpartialpartial vecx left(Avecx + vecbright)operatornamediagleft(f'left(Avecx + vecbright)right) = Aoperatornamediagleft(f'left(Avecx + vecbright)right)$$
matrix-calculus
$endgroup$
I want to calculate $fracpartialpartial vecx fleft(Avecx + vecbright)$ where $vecx, vecb in mathbbR^n$ and $f: mathbbR^n rightarrow mathbbR^n$ which is applied element-wise. Is it correct that since both $vecx$ and $fleft(Avecx + vecbright)$ are vectors the partial derivative must be a Jacobian matrix? I tried applying the chain rule and various identities I have found on Wikipedia, but I am very unsure about the result:
$$fracpartialpartial vecx fleft(Avecx + vecbright) = fracpartialpartial vecx left(Avecx + vecbright)operatornamediagleft(f'left(Avecx + vecbright)right) = Aoperatornamediagleft(f'left(Avecx + vecbright)right)$$
matrix-calculus
matrix-calculus
edited Mar 21 '16 at 15:12
Lenar Hoyt
asked Mar 21 '16 at 14:49
Lenar HoytLenar Hoyt
534618
534618
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
$begingroup$
It will be in Jacobian form:
$fracdelta (f_i)delta(x_j)(Ax+b) * A = Jf(Ax+b)*A$
where $f(x_1,...,x_n) = (f_1(x_1,...,x_n),...f_n(x_1,...,x_n))$
$endgroup$
add a comment |
$begingroup$
I'll assume that you have a specific function in mind, for which you know the derivative,
$$eqalign
fracdf(z)dz &= g(z) cr
df &= g,dz cr
$$
When this function is applied element-wise to a vector argument,
the Hadamard ($circ$) Product must be used in the differential
$$eqalign
df &= gcirc dz cr
$$
For this problem, define
$$eqalign
z &= Ax + b cr
dz &= A,dx cr
$$
then the differential of your function is
$$eqalign
df &= gcirc dz cr
&= G,dz cr
&= GA,dx cr
fracpartial fpartial x &= GA cr
$$
where the matrix
$,G = rm Diag(g)$
$endgroup$
add a comment |
$begingroup$
Yes, it is a Jacobian matrix. When I get confused with vectors/tensors ("was there a transpose?"), I always start writing down a couple of components and then try to infer what the general expression is.
If you tried but still can't figure it out, read further. Let's compute the derivative of the $i$-th component of $f$ with respect of the $j$-th componente of $x$. To do this, don't forget that every component of $Ax+b$ depends on $x_j$, so we need to use the chain rule $n$ times.
$$
partial_x_j(f_i(Ax+b)) =\
(partial_x_1f_i)(Ax+b)cdot partial_x_j(Ax+b)_1+cdots+(partial_x_nf_i)(Ax+b)cdot partial_x_j(Ax+b)_n\
=(partial_x_1f_i)(Ax+b)cdot partial_x_ja_1j+cdots+(partial_x_nf_i)(Ax+b)cdot partial_x_ja_nj\
=(nabla f_i)(Ax+b)cdot a_j
$$
where $a_j$ is the $j$-th column of $A$. So how does this read when we put all the components together? The entry $J_ij$ of the Jacobian is what we just computed. Well, $J_ij$ is the product of the $i$-th row of $J_f$ with the $j$-th column of $A$. Therefore, denoting products with $*$ to not confuse with function evaluation,
$$
J_f(Ax+b) = J_f(Ax+b)*A.
$$
$endgroup$
add a comment |
$begingroup$
What is your definition of $fracpartialpartial vec x$?
If we use the definition
$$
fracpartial g partial vec x(vec a) = lim_h to 0 fracg(a+h vec x)-g(a)h,
$$
(for a function $g:mathbb R^n to mathbb R$), then the usual rules of limits should give the answer $A$.
$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%2f1707261%2fhow-can-i-calculate-the-partial-derivative-frac-partial-partial-vecx-f%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
It will be in Jacobian form:
$fracdelta (f_i)delta(x_j)(Ax+b) * A = Jf(Ax+b)*A$
where $f(x_1,...,x_n) = (f_1(x_1,...,x_n),...f_n(x_1,...,x_n))$
$endgroup$
add a comment |
$begingroup$
It will be in Jacobian form:
$fracdelta (f_i)delta(x_j)(Ax+b) * A = Jf(Ax+b)*A$
where $f(x_1,...,x_n) = (f_1(x_1,...,x_n),...f_n(x_1,...,x_n))$
$endgroup$
add a comment |
$begingroup$
It will be in Jacobian form:
$fracdelta (f_i)delta(x_j)(Ax+b) * A = Jf(Ax+b)*A$
where $f(x_1,...,x_n) = (f_1(x_1,...,x_n),...f_n(x_1,...,x_n))$
$endgroup$
It will be in Jacobian form:
$fracdelta (f_i)delta(x_j)(Ax+b) * A = Jf(Ax+b)*A$
where $f(x_1,...,x_n) = (f_1(x_1,...,x_n),...f_n(x_1,...,x_n))$
answered Mar 21 '16 at 15:18
crbahcrbah
1,08246
1,08246
add a comment |
add a comment |
$begingroup$
I'll assume that you have a specific function in mind, for which you know the derivative,
$$eqalign
fracdf(z)dz &= g(z) cr
df &= g,dz cr
$$
When this function is applied element-wise to a vector argument,
the Hadamard ($circ$) Product must be used in the differential
$$eqalign
df &= gcirc dz cr
$$
For this problem, define
$$eqalign
z &= Ax + b cr
dz &= A,dx cr
$$
then the differential of your function is
$$eqalign
df &= gcirc dz cr
&= G,dz cr
&= GA,dx cr
fracpartial fpartial x &= GA cr
$$
where the matrix
$,G = rm Diag(g)$
$endgroup$
add a comment |
$begingroup$
I'll assume that you have a specific function in mind, for which you know the derivative,
$$eqalign
fracdf(z)dz &= g(z) cr
df &= g,dz cr
$$
When this function is applied element-wise to a vector argument,
the Hadamard ($circ$) Product must be used in the differential
$$eqalign
df &= gcirc dz cr
$$
For this problem, define
$$eqalign
z &= Ax + b cr
dz &= A,dx cr
$$
then the differential of your function is
$$eqalign
df &= gcirc dz cr
&= G,dz cr
&= GA,dx cr
fracpartial fpartial x &= GA cr
$$
where the matrix
$,G = rm Diag(g)$
$endgroup$
add a comment |
$begingroup$
I'll assume that you have a specific function in mind, for which you know the derivative,
$$eqalign
fracdf(z)dz &= g(z) cr
df &= g,dz cr
$$
When this function is applied element-wise to a vector argument,
the Hadamard ($circ$) Product must be used in the differential
$$eqalign
df &= gcirc dz cr
$$
For this problem, define
$$eqalign
z &= Ax + b cr
dz &= A,dx cr
$$
then the differential of your function is
$$eqalign
df &= gcirc dz cr
&= G,dz cr
&= GA,dx cr
fracpartial fpartial x &= GA cr
$$
where the matrix
$,G = rm Diag(g)$
$endgroup$
I'll assume that you have a specific function in mind, for which you know the derivative,
$$eqalign
fracdf(z)dz &= g(z) cr
df &= g,dz cr
$$
When this function is applied element-wise to a vector argument,
the Hadamard ($circ$) Product must be used in the differential
$$eqalign
df &= gcirc dz cr
$$
For this problem, define
$$eqalign
z &= Ax + b cr
dz &= A,dx cr
$$
then the differential of your function is
$$eqalign
df &= gcirc dz cr
&= G,dz cr
&= GA,dx cr
fracpartial fpartial x &= GA cr
$$
where the matrix
$,G = rm Diag(g)$
edited Mar 20 at 17:46
answered Mar 21 '16 at 16:43
lynnlynn
2,116177
2,116177
add a comment |
add a comment |
$begingroup$
Yes, it is a Jacobian matrix. When I get confused with vectors/tensors ("was there a transpose?"), I always start writing down a couple of components and then try to infer what the general expression is.
If you tried but still can't figure it out, read further. Let's compute the derivative of the $i$-th component of $f$ with respect of the $j$-th componente of $x$. To do this, don't forget that every component of $Ax+b$ depends on $x_j$, so we need to use the chain rule $n$ times.
$$
partial_x_j(f_i(Ax+b)) =\
(partial_x_1f_i)(Ax+b)cdot partial_x_j(Ax+b)_1+cdots+(partial_x_nf_i)(Ax+b)cdot partial_x_j(Ax+b)_n\
=(partial_x_1f_i)(Ax+b)cdot partial_x_ja_1j+cdots+(partial_x_nf_i)(Ax+b)cdot partial_x_ja_nj\
=(nabla f_i)(Ax+b)cdot a_j
$$
where $a_j$ is the $j$-th column of $A$. So how does this read when we put all the components together? The entry $J_ij$ of the Jacobian is what we just computed. Well, $J_ij$ is the product of the $i$-th row of $J_f$ with the $j$-th column of $A$. Therefore, denoting products with $*$ to not confuse with function evaluation,
$$
J_f(Ax+b) = J_f(Ax+b)*A.
$$
$endgroup$
add a comment |
$begingroup$
Yes, it is a Jacobian matrix. When I get confused with vectors/tensors ("was there a transpose?"), I always start writing down a couple of components and then try to infer what the general expression is.
If you tried but still can't figure it out, read further. Let's compute the derivative of the $i$-th component of $f$ with respect of the $j$-th componente of $x$. To do this, don't forget that every component of $Ax+b$ depends on $x_j$, so we need to use the chain rule $n$ times.
$$
partial_x_j(f_i(Ax+b)) =\
(partial_x_1f_i)(Ax+b)cdot partial_x_j(Ax+b)_1+cdots+(partial_x_nf_i)(Ax+b)cdot partial_x_j(Ax+b)_n\
=(partial_x_1f_i)(Ax+b)cdot partial_x_ja_1j+cdots+(partial_x_nf_i)(Ax+b)cdot partial_x_ja_nj\
=(nabla f_i)(Ax+b)cdot a_j
$$
where $a_j$ is the $j$-th column of $A$. So how does this read when we put all the components together? The entry $J_ij$ of the Jacobian is what we just computed. Well, $J_ij$ is the product of the $i$-th row of $J_f$ with the $j$-th column of $A$. Therefore, denoting products with $*$ to not confuse with function evaluation,
$$
J_f(Ax+b) = J_f(Ax+b)*A.
$$
$endgroup$
add a comment |
$begingroup$
Yes, it is a Jacobian matrix. When I get confused with vectors/tensors ("was there a transpose?"), I always start writing down a couple of components and then try to infer what the general expression is.
If you tried but still can't figure it out, read further. Let's compute the derivative of the $i$-th component of $f$ with respect of the $j$-th componente of $x$. To do this, don't forget that every component of $Ax+b$ depends on $x_j$, so we need to use the chain rule $n$ times.
$$
partial_x_j(f_i(Ax+b)) =\
(partial_x_1f_i)(Ax+b)cdot partial_x_j(Ax+b)_1+cdots+(partial_x_nf_i)(Ax+b)cdot partial_x_j(Ax+b)_n\
=(partial_x_1f_i)(Ax+b)cdot partial_x_ja_1j+cdots+(partial_x_nf_i)(Ax+b)cdot partial_x_ja_nj\
=(nabla f_i)(Ax+b)cdot a_j
$$
where $a_j$ is the $j$-th column of $A$. So how does this read when we put all the components together? The entry $J_ij$ of the Jacobian is what we just computed. Well, $J_ij$ is the product of the $i$-th row of $J_f$ with the $j$-th column of $A$. Therefore, denoting products with $*$ to not confuse with function evaluation,
$$
J_f(Ax+b) = J_f(Ax+b)*A.
$$
$endgroup$
Yes, it is a Jacobian matrix. When I get confused with vectors/tensors ("was there a transpose?"), I always start writing down a couple of components and then try to infer what the general expression is.
If you tried but still can't figure it out, read further. Let's compute the derivative of the $i$-th component of $f$ with respect of the $j$-th componente of $x$. To do this, don't forget that every component of $Ax+b$ depends on $x_j$, so we need to use the chain rule $n$ times.
$$
partial_x_j(f_i(Ax+b)) =\
(partial_x_1f_i)(Ax+b)cdot partial_x_j(Ax+b)_1+cdots+(partial_x_nf_i)(Ax+b)cdot partial_x_j(Ax+b)_n\
=(partial_x_1f_i)(Ax+b)cdot partial_x_ja_1j+cdots+(partial_x_nf_i)(Ax+b)cdot partial_x_ja_nj\
=(nabla f_i)(Ax+b)cdot a_j
$$
where $a_j$ is the $j$-th column of $A$. So how does this read when we put all the components together? The entry $J_ij$ of the Jacobian is what we just computed. Well, $J_ij$ is the product of the $i$-th row of $J_f$ with the $j$-th column of $A$. Therefore, denoting products with $*$ to not confuse with function evaluation,
$$
J_f(Ax+b) = J_f(Ax+b)*A.
$$
answered Mar 21 '16 at 15:15
bartgolbartgol
5,0781420
5,0781420
add a comment |
add a comment |
$begingroup$
What is your definition of $fracpartialpartial vec x$?
If we use the definition
$$
fracpartial g partial vec x(vec a) = lim_h to 0 fracg(a+h vec x)-g(a)h,
$$
(for a function $g:mathbb R^n to mathbb R$), then the usual rules of limits should give the answer $A$.
$endgroup$
add a comment |
$begingroup$
What is your definition of $fracpartialpartial vec x$?
If we use the definition
$$
fracpartial g partial vec x(vec a) = lim_h to 0 fracg(a+h vec x)-g(a)h,
$$
(for a function $g:mathbb R^n to mathbb R$), then the usual rules of limits should give the answer $A$.
$endgroup$
add a comment |
$begingroup$
What is your definition of $fracpartialpartial vec x$?
If we use the definition
$$
fracpartial g partial vec x(vec a) = lim_h to 0 fracg(a+h vec x)-g(a)h,
$$
(for a function $g:mathbb R^n to mathbb R$), then the usual rules of limits should give the answer $A$.
$endgroup$
What is your definition of $fracpartialpartial vec x$?
If we use the definition
$$
fracpartial g partial vec x(vec a) = lim_h to 0 fracg(a+h vec x)-g(a)h,
$$
(for a function $g:mathbb R^n to mathbb R$), then the usual rules of limits should give the answer $A$.
answered Mar 21 '16 at 14:56
Fredrik MeyerFredrik Meyer
15.3k24165
15.3k24165
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%2f1707261%2fhow-can-i-calculate-the-partial-derivative-frac-partial-partial-vecx-f%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