matrix gradient

195 Views Asked by At

I found the gradient of an optimization problem as

$$ b*I + \rho\big(-A+diag(A)+X-2diag(X)\big) = 0 $$

But my problem is, I want to find the equation for $X$. From the above equation, because of the $diag(X)$, I am not able to find a closed form for $X$. Is there any way, we can write $diag(X)$ in terms of $X$.

$diag(X)$ is the matrix containing only the diagonal entries of $X$.

The original problem is $$ b*tr(X) + tr\big(\delta^T(A-X+diag(X)\big) + \frac{\rho}{2}\lvert\lvert A-X+diag(X)\lvert\lvert_{fro}^2 $$

$tr$ is the trace and $fro$ Frobenius norm.

I am trying to find the value of X that minizes/maximizes the objective


1

There are 1 best solutions below

3
On BEST ANSWER

To solve for $X$ consider the diagonal and off-diagonal terms separately.

Let $F=(1-I)$, where $1$ is the matrix of all ones. Then the operations to extract the diagonal and off-diagonal terms can be represented using the Hadamard ($\circ$) product as $$\eqalign{ {\rm diag}(X) &= I\circ X \cr {\rm offdiag}(X) &= F\circ X \cr }$$ The equation to be solved can be written as $$\eqalign{ X-2I\circ X &= (A-I\circ A) - B/\rho \cr }$$ Before we begin, note that $$\eqalign{ I\circ I &= I \cr F\circ I &= 0 \cr }$$ The diagonal components of the equation are $$\eqalign{ I\circ X - 2I\circ I\circ X &= (I\circ A-I\circ I\circ A)-I\circ B/\rho \cr -I\circ X &= (0)-I\circ B/\rho \cr I\circ X &= I\circ B/\rho \cr }$$ and the off-diagonal components are $$\eqalign{ F\circ X - 2F\circ I\circ X &= (F\circ A-F\circ I\circ A)-F\circ B/\rho \cr F\circ X - (0) &= (F\circ A)-F\circ B/\rho \cr F\circ X &= F\circ(A-B/\rho) \cr }$$ Add the two pieces together to find X $$\eqalign{ F\circ X + I\circ X &= F\circ(A-B/\rho) + I\circ B/\rho \cr X &= F\circ(A-B/\rho) + I\circ B/\rho \cr }$$