I have the following diagonal matrix $$ \underset{d \times d}{\boldsymbol{W}} = \begin{bmatrix} \left( y_1 +\dfrac{1 - y_1}{x_1} \right)^{-1} & 0 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & \left( y_d +\dfrac{1 - y_d}{x_d} \right)^{-1} \end{bmatrix} $$ and I need to take the derivative of $\boldsymbol{W}$, $\ln \lvert \boldsymbol{W} \boldsymbol{A} \rvert$, and $\boldsymbol{B} \boldsymbol{W}^{-1} \boldsymbol{C}$ with respect to vector $\boldsymbol{x} = (x_1, \dots, x_d)^\top$, where $\boldsymbol{A}, \boldsymbol{B}$, and $\boldsymbol{C}$ are all $d \times d$ matrices. I don't know if it is feasible to do so. Intuitively, if I just take the derivative of a single diagonal entry of $\boldsymbol{W}$, say $\left( y_1 +\dfrac{1 - y_1}{x_1} \right)^{-1}$, with the corresponding $x_1$, I will get $$-\left( y_1 +\dfrac{1 - y_1}{x_1} \right)^{-2} \left( -\dfrac{1 - y_1}{x^2_1} \right),$$ which I hardly relate a matrix to such a result. Or maybe my linear algebra and matrix calculus skill is not there yet. If anyone has a clue, please help me. Thank you so much.
2026-04-24 09:45:46.1777023946
Derivative of a diagonal matrix with respect to a vector whose entries appear in the matrix
473 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in LINEAR-ALGEBRA
- An underdetermined system derived for rotated coordinate system
- How to prove the following equality with matrix norm?
- Alternate basis for a subspace of $\mathcal P_3(\mathbb R)$?
- Why the derivative of $T(\gamma(s))$ is $T$ if this composition is not a linear transformation?
- Why is necessary ask $F$ to be infinite in order to obtain: $ f(v)=0$ for all $ f\in V^* \implies v=0 $
- I don't understand this $\left(\left[T\right]^B_C\right)^{-1}=\left[T^{-1}\right]^C_B$
- Summation in subsets
- $C=AB-BA$. If $CA=AC$, then $C$ is not invertible.
- Basis of span in $R^4$
- Prove if A is regular skew symmetric, I+A is regular (with obstacles)
Related Questions in MATRICES
- How to prove the following equality with matrix norm?
- I don't understand this $\left(\left[T\right]^B_C\right)^{-1}=\left[T^{-1}\right]^C_B$
- Powers of a simple matrix and Catalan numbers
- Gradient of Cost Function To Find Matrix Factorization
- Particular commutator matrix is strictly lower triangular, or at least annihilates last base vector
- Inverse of a triangular-by-block $3 \times 3$ matrix
- Form square matrix out of a non square matrix to calculate determinant
- Extending a linear action to monomials of higher degree
- Eiegenspectrum on subtracting a diagonal matrix
- For a $G$ a finite subgroup of $\mathbb{GL}_2(\mathbb{R})$ of rank $3$, show that $f^2 = \textrm{Id}$ for all $f \in G$
Related Questions in MATRIX-CALCULUS
- How to compute derivative with respect to a matrix?
- Definition of matrix valued smooth function
- Is it possible in this case to calculate the derivative with matrix notation?
- Monoid but not a group
- Can it be proved that non-symmetric matrix $A$ will always have real eigen values?.
- Gradient of transpose of a vector.
- Gradient of integral of vector norm
- Real eigenvalues of a non-symmetric matrix $A$ ?.
- How to differentiate sum of matrix multiplication?
- Derivative of $\log(\det(X+X^T)/2 )$ with respect to $X$
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
$\def\c#1{\color{red}{#1}}\def\v{{\rm vec}}\def\d{{\rm diag}}\def\D{{\rm Diag}}\def\o{{\tt1}}\def\p#1#2{\frac{\partial #1}{\partial #2}}$Define the diagonal matrices $$\eqalign{ X &= \D(x), \qquad Y &= \D(y) \\ }$$ Then the $W$ matrix is defined such that $$\eqalign{ W^{-1} &= Y + X^{-1}(I-Y) \\ }$$ and its differential can be calculated as $$\eqalign{ dW^{-1} &= dX^{-1}(I-Y) \\ W^{-1}dW\,W^{-1} &= X^{-1}dX\,X^{-1}(I-Y) \\ dW &= WX^{-1}dX\,\c{X^{-1}(I-Y)}W \\ &= WX^{-1}dX\,\c{(W^{-1}-Y)}W \\ &= WX^{-1}dX\,(I-YW) \\ }$$ Finally, set $\,M=WA\;$ and use Jacobi's formula for your middle function. $$\eqalign{ \lambda &= \log(\det(M)) \\ d\lambda &= M^{-T}:dM \\ &= (WA)^{-T}:dW\,A \\ &= W^{-1}A^{-T}A^T:dW \\ &= W^{-1}:dW \\ &= W^{-1}:WX^{-1}dX\,{(I-YW)} \\ &= X^{-1}(I-YW):dX \\ &= \d\Big(\big(I-YW\big)X^{-1}\Big):dx \\ \p{\lambda}{x} &= \d\Big(\big(I-YW\big)X^{-1}\Big) \;=\; \big(\o-y\odot w\big)\oslash x \\ }$$ That was the simple function. The problem with the remaining functions is that a matrix-by-vector gradient is a third-order tensor, which cannot be represented in standard matrix notation.
However, since $W$ is diagonal we can calculate the gradient of $w=\d(W)$ with respect to $x$. $$\eqalign{ dw &= \d(dW) \\ &= \d\Big(WX^{-1}dX\,(I-YW)\Big) \\ &= \left(WX^{-1}(I-YW)\right)dx \\ &= \big(W-YW^2\big)X^{-1}\,dx \\ \p{w}{x} &= \big(W-YW^2\big)X^{-1} \\\\ }$$ To tackle the final function note that $$\eqalign{ Q &= W^{-1} \\ dQ &= -X^{-1}dX\,X^{-1}(I-Y) \\ dq &= \d(dQ) \;=\; (Y-I)X^{-2}\,dx \\ }$$ Then vectorize the matrix using the Khatri-Rao product. $$\eqalign{ P &= BW^{-1}C \\&= BQC \\ p &= \v(P) \\ &= \left(C^T\boxtimes B\right) q \\ dp &= \left(C^T\boxtimes B\right)\,dq \\ &= \left(C^T\boxtimes B\right)(Y-I)X^{-2}\,dx \\ \p{p}{x} &= \left(C^T\boxtimes B\right)(Y-I)X^{-2} \\ }$$
In the steps above, $\odot$ denotes the elementwise/Hadamard product, $\oslash$ denotes Hadamard division, and a colon denotes the trace/Frobenius product, i.e. $$\eqalign{ A:B &= {\rm Tr}(AB^T) \;=\; \sum_{i=1}^m \sum_{j=1}^n A_{ij} B_{ij} \\ A:A &= \big\|A\big\|^2_F \\ }$$ The properties of the underlying trace function permit the terms in such a product to be rearranged in several equivalent ways $$\eqalign{ A:B &= B:A = B^T:A^T \\ CA:B &= C:BA^T = A:C^TB \\ }$$ Note that the matrix on each side of the colon must have the same dimensions.
The Khatri-Rao product can be defined as $$\eqalign{ C^T\boxtimes B &= (C^T\otimes\o)\odot(\o\otimes B) \;\in\; {\mathbb R}^{n^2\times n} \\ }$$ where $\otimes$ denotes the Kronecker product and $\,\o=\d(I)\,$ is the all-ones vector.