# How to compute $\mathrm{proj}_{SDP}(C\odot X)./C$ without numerical problems?

I have a matrix, $X$, it is symmetric. I project $C \odot X$ and $D\odot X$ to semidefinite cone. $C$ is a Gramian matrix with some elements near zero and of course semidefinite, with one row and column equal to zero. $D$ is a matrix of ones except one column and row equal to zero (not the same column and row as $D$). Both are symmetric. After projection, I want to obtain $X':=\mathrm{proj}(C\odot X)./C$, (element wise division) but some values became very large, may because of corresponding elements in the matrix $C$.

How to correctly obtain $X'$?

• You mention $D$ early in your question and then don't talk about it again. Are you asking the same question about $C$ and $D$? Mar 2 '16 at 16:31
• I talk about $D$, just to tell why I need $X$. otherwise someone may think just do all computations based on $C\odot X$. Mar 2 '16 at 20:42

$$C = \left(\begin{array}{ccc} 2 & 1 & \epsilon\\ 1 & 2 & 1\\ \epsilon & 1 & 2 \end{array}\right)$$ and $$X = \left(\begin{array}{ccc} -1 & -1 & 1\\ -1 & 1 & 1\\ 1 & 1 & 1\\ \end{array}\right).$$ Note that $X$ has eigenvalues $\{1, \pm 2\}$ and $C$ has eigenvalues within $2\epsilon$ of $\{2 - \sqrt{2}, 2, 2 + \sqrt{2}\}$; these are not close to singular.
However, you can compute that $\mathrm{proj}_{SDP}(C .*X)$ is very close to (entrywise within $10^{-3} + \epsilon$ or so of) the matrix $$\left(\begin{array}{ccc} 0.111 & 0.474 & 0.124\\ 0.474 & 2.131 & 0.969\\ 0.124 & 0.969 & 2.007\\ \end{array}\right),$$ which has some very nonzero entries where $C$ has $\epsilon$'s.
• what should I do?. Is it correct to replace entries of $C$ less than epsilon, with one and then do the element wise division? Mar 3 '16 at 8:40
• Is it make the problem different if $X(1:n-1,1:n-1)$ itself and also, $C$ are semidefinite matrices? Mar 3 '16 at 8:42
• I have no idea what your application is. If you don't want big numbers in your result, though, you probably don't want to try to solve this problem. You can permute the rows and columns of the $X$ I gave to find a very similar nasty case for your modified problem Mar 3 '16 at 14:47