I have been working on a problem that asks the following: given a matrix
$$\begin{pmatrix} 0 & 1 & 3\\ 3 & 1 & 0 \end{pmatrix},$$ I need to find a matrix $M$ such that $rank(M) = 1$ that better approximates A. That is, I have to find a matrix of type $$M = \begin{pmatrix} a & b & c\\ ra & rb & rc \end{pmatrix},$$ such that the (real) values $a, b, c, r$ are such that it minimizes the following expression:
$(a^2) + (1-b)^2 + (3-c)^2 + (3-ra)^2 + (1-rb)^2 + (rc)^2$ (that is, the Frobenius norm of the difference $A-M$).
I know that I can do it by finding the minimmum of a function on 4 variables. But I was trying to find a better and clever way to do this, but I wasn't able to do so.
I would appreciate if you could come up with any ideas that could make this problem more easy to solve.
(Edit 1) Maybe an idea could arise out of a decomposition of this matrix into a product (for instance, LU decomposition or something like this).
The EYM theorem states that this approximation may be obtained using the singular value decomposition. In particular, we proceed as follows.
Begin by computing the singular value decomposition $A = U \Sigma V^T$, where $$ A = \pmatrix{0 & 1 & 3\\ 3 & 1 & 0}, \quad U = \frac 1{\sqrt{2}}\pmatrix{1&-1\\1&1}, \quad \Sigma = \pmatrix{\sqrt{11}\\ & 3}, \quad \\ V = \pmatrix{ 3/\sqrt{22} & 1/\sqrt{2} & 1/\sqrt{11}\\ \sqrt{2/11} & 0 & -3/\sqrt{11}\\ 3/\sqrt{22} & -1/\sqrt{2} & 1/\sqrt{11}}. $$ Then, compute the rank-1 "truncated SVD" $M = U \hat \Sigma V$, where $$ \hat \Sigma = \pmatrix{\sqrt{11}&0\\0&0}. $$ Equivalently, we find $$ M = \sqrt{11} \cdot \frac 1{\sqrt{2}}\pmatrix{1\\1}\pmatrix{3/\sqrt{22} & \sqrt{2/11} & 3/\sqrt{22}} \\ = \left(\begin{matrix}1.5 & 1.0 & 1.5\\1.5 & 1.0 & 1.5\end{matrix}\right). $$