Given matrices A,B,C and column vector v, what is the derivative of ⟨Adiag(Bv),C⟩with respect to B?

Chelsea Pruitt

Chelsea Pruitt

Answered question

2022-10-15

Given matrices A,B,C and column vector v , what is the derivative of A diag ( B v ) , C with respect to B ? diag(⋅) is a diagonal matrix with the argument as the diagonal and the brackets signify the inner product.
I am trying to find the solution, but am hung up on differentiating the diagonal matrix.

Answer & Explanation

megagoalai

megagoalai

Beginner2022-10-16Added 22 answers

The derivative can always be computed by going back to the original limit definition. For a vector-valued function f : X Y, its derivative at a point x, denoted D f ( x ), if it exists, is given by
[ D f ( x ) ] z = lim h 0 h 1 ( f ( x + h z ) f ( x ) ) .
In other words, if the true (Frechet) derivative exists, then you can compute it by computing directional (Gateaux) derivatives.
In your case, f ( X ) = A d i a g ( X v ) , C , where X is the variable (B in your original question). Then perhaps you can verify that
[ D f ( X ) ] Z = A d i a g ( Z v ) , C
Mattie Monroe

Mattie Monroe

Beginner2022-10-17Added 3 answers

Let rewrite the cost function
ϕ = A d i a g ( B v ) : C = d i a g ( B v ) : A T C = B v : d i a g ( A T C ) = d i a g ( A T C ) v T : B
I used the colon operator for the Frobenius inner product. Also diag(X) extracts the diagonal element of X into a vector. The derivative is
ϕ B = d i a g ( A T C ) v T

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?