If I have a square matrix in $\mathbf{A} \in \mathbb{R}^{n \times n}$, I want to find another diagonal matrix $\mathbf{D} \in \mathbb{R}^{n \times n}$ that minimizes the residual $ \min\_\mathbf{D} || \mathbf{A-D} ||^2 $, where the norm here is the induced norm $\max\_{x\neq 0} \frac{\mathbf{||Ax||\_2}}{\mathbf{||x||\_2}}$. Is there a currently-known closed form for this optimization? 



A Closed Form for the Diagonal Matrix Nearest an Arbitrary Square Matrix
The case of the $2$-norm may well not have a closed form. However, in the Frobenius norm the problem has a trivial answer: $D\_A = \mathrm{diag}(A)$. Since $\| A \|\_2 \leq \| A \|\_F \leq \sqrt{n} \| A \|\_2$, one then has that
$$
\frac{1}{\sqrt{n}} \| A - D\_A \| \leq \min\_{D} \| A - D \| \leq \| A - D\_A \|,
$$
which, at the least, gives a bound.


