# Find the Matrix Projection of a Symmetric Matrix onto the set of Symmetric Positive Semi Definite (PSD) Matrices

Consider $\mathbb{S}^n$, the set of all $n\times n$ real symmetric matrices. Let $A\in \mathbb{S}^n$ and $A=U\Lambda U^{\top}$ be its spectral decomposition. I want to know how to prove that $\Pi_{\Bbb S_+^n}(A)=U\Lambda ^+U^{\top}$, where $\Lambda^+$ is the $n\times n$ diagonal matrix given by $\Lambda_{ii}^+=\max\{\Lambda_{ii}, 0\}$, for $i=1,...,n$；$\Pi_{S}(x)=\arg\min_{z\in S}\|x-z\|^2_2$.

This projection means that we can project any symmetric matrix on $\mathbb{S}_+^n$ and get the closest positive semi-definite matrix, but how can we prove that it is the closest one?

• Show that $\Pi_S(U A U^T) = U \Pi_S(A) U^T$ (as long as $USU^T = S$). Solving the problem for diagonal $A$ should be straightforward. – copper.hat Sep 19 '17 at 14:44
• Also think carefully about what norm you're using for "closest." – Brian Borchers Sep 19 '17 at 14:53

## 1 Answer

$\Pi_{\mathbb{S}_+^n}(A)=\arg\min_{X \in \mathbb{S}_+^n}\|X-A\|^2_F=\arg\min_{X \in \mathbb{S}_+^n}\|\Lambda_X -V^{\top}A V\|^2_F$

$X = V \Lambda_X V^{\top}$ (as $X\in \mathbb{S}^n_+$, so it is diagolalizable), $B=V^{\top}A V$

$\|\Lambda_X -V^{\top}A V\|^2_F = \sum_{i \neq j}b_{ij}^2+\sum_i (\Lambda_{X_{ii}}-b_{ii})^2$

Minimum occurs when $b_{ij}=0$, and $\Lambda_{X_{ii}}=b_{ii}$. Note that $\Lambda_{X_{ii}} \geq 0$, so $\Lambda_{X_{ii}}=\max\{0,b_{ii}\}.$ $B$ is a diagonal matrix. So, $V=U$.