Euclidean Projection Implementation on cvx

There is actually one entry 0.0072 which is very small ,I believe it could be negligible.
I have another question

Is there a way where I could modify the constraints in such a way that I could get a sparser matrix? Please let me know.

You could try doing something with a vector one norm in the objective or a constraint, which perhaps might help induce sparsity. But how to induce sparsity is a modeling question outside the scope of this forum.

Hi again. I am a bit confused in giving a positive semidefinite constraint in cvx for my Euclidean Projection problem. I have two versions of my function

image

where I used sdp solver and then I added Z>=0 as a constraint in order to obtain the positive semidefinite matrix.

The other version is
image

where I dont use sdp and Z>=0 constraint instead I use semidefinite(n).

What is the difference between both these versions. I have two sets of data. One from the power and the other is weather. The first version works perfectly well for power but fails in weather data but the second version works perfectly well for weather but fails in power.

You would need Z - 1e-5*eye(N) >= 0 in the first version for the semidefinite constraint to be the same as the 2nd version. The first version is missing vec(Z-diag(diag(X))) <= 0, which is in the 2nd version.

A follow-up of my comment in this link above.

image

This version of Euclidean Projection perfectly well.
But this time I had to normalize/divide my input signal with a small coefficient (like a scalar value=0.005).

When I run this function on those signals cvx status is shown as Failed with optval as NaN but then the final result which I got is a valid Laplacian matrix satisfying all of the constraints. The graph I procured from this Laplacian matrix is also perfectly good after visualizing it.

If I comment the constraint vec(Z-diag(diag(X))) <= 0 and run my cvx code. The status now is solved with some optvalue but the final result is not a valid Laplacian since it fails to meet vec(Z-diag(diag(X))) <= 0 constraint.

This looks a bit confusing for me.