Given a real-valued, symmetric matrix $A \in \mathbb{R}^{n \times n}$, I'm interested in finding the closest positive semi-definite matrix $X^*\in \mathbb{R}^{n \times n}$:
$$ X^* = \mathop{\text{argmin}}_{X \succcurlyeq 0} \| X - A \|_F^2 $$
One way I can solve this is by exploiting the eigendecomposition of $A$:
$$V \Lambda V^T = A$$
where $\Lambda$ is a diagonal matrix of eigenvalues. Then we have
$$X^* = V \max\left( \Lambda, 0 \right) V^T$$
where we've reconstructed from the eigen decomposition but clamped all the negative eigenvalues to zero.
If $A$ is a dense matrix, manifesting the eigendecomposition could take $O(n^3)$. Could we compute $X^*$ somehow more directly in a faster way?
In particular, now assume that $A$ has $k$ negative eigen-values. Would it be possible to construct an algorithm that ran in something like $O(kn^2)$ operations?
This way if my matrix $A$ is already positive definite, I'm not doing many more operations than just reading it in?
I suppose a corollary question to this might be, can you verify that a matrix is positive semi-definite in $O(n^2)$ operations?