Solving Frobenius minimization with linear algebra Given that $A$ is a symmetric matrix, find $X$ that solves
$$\mathop {\min }\limits_X {\left\| {A - X{X^T}} \right\|_F}$$
I think that the problem can be solved using eigenvalue or singular value decomposition technics. $XX^T=A$ seems an obvious solution, but the problem is that $XX^T$ is positive semidefinite, while $A$ may not be, although they are both symmetric.
At this point I am thinking about taking eigenvalue decomposition of A, then replacing the negative eigenvalues in the middle diagonal matrix with 0-s (denote the resulting matrix by $\bar{A}$). But am having difficulties to understand why  $XX^T=\bar{A}$ gives the $X$ with minimal distance from A.
 A: Your approach is the correct one: Compute the eigenvalue decomposition $A = USU^T$, set $S_0 = \sqrt{\max(S,0)}$ (element wise) and set $X = US_0$. The reference that justifies this is 
N. Higham, Computing a nearest symmetric positive semidefinite matrix, Linear algebra and its applications vol. 103 (1988), 103-118.
A: A multiplication by a unitary matrix preserves the Frobenius norm of a matrix, so if $A= V D V^T$ is the spectral decomposition of $A$, for some $X$ we have $XX^T = V D_{\geq 0} V^T$ (since the RHS is a positive semidefinite matrix) and in such a case $\|A-XX^T\|_F=\|D-D_{\geq 0}\|_F$ is just the $l_2$ norm of the negative part of the spectrum of $A$. If $XX^T$ and $A$ are not simultaneously diagonalizable then $\|A-XX^T\|_F$ is greater than that quantity, hence:
$$ \min_{X}\|A-XX^T\|_F = \sqrt{\sum_{\substack{\lambda\in\text{Spec} A\\ \lambda<0}}\lambda^2}$$
and an interesting consequence is that if $A$ is a symmetric matrix and $XX^T$ is an "approximate Cholesky decomposition" of $A$, i.e. if $\|A-XX^T\|_F$ is small, the $l_2$ norm of the negative part of the spectrum of $A$ is bounded in terms of the approximation error.
