I want to minimize $f(x) = \mathrm{Tr}(\sqrt{\mathbf{X}^{T}\mathbf{X}}\mathbf{A})$, where $\mathbf{X}$ is an matrix variable of dimension $d \times d$, and $\mathbf{A}$ is a known matrix. I tried the following code:
cvx_begin
variable x(d,d)
minimize(trace(sqrt(sum_square_abs(x))*A))
subject to
x(sp_index) == M(sp_index)
cvx_end
However, there are still errors as following:
Error using cvx/sqrt (line 61)
Disciplined convex programming error:
Illegal operation: sqrt( {convex} ).
Error in Test_CVX_Iterative_Optimal (line 34)
minimize(trace(sqrt(sum_square_abs(x))*A))
So how should I solve this problem by CVX? Looking forward to your reply! I also asked the same question in the CVX forum http://ask.cvxr.com/question/2894 but haven't got it solved yet. Wish anyone here is able to offer help!
Update:
Thanks to @DavidKetcheson , I should use sqrtm() rather than sqrt. To represent $\mathrm{Tr}(\sqrt{\mathbf{X}^T\mathbf{X}})$ I should use trace_sqrtm(sum_square_abs(x)). However, I need to represent $\mathrm{Tr}(\sqrt{\mathbf{X}^T\mathbf{X}}\mathbf{A})$, and I don't know how to represent it by a valid CVX expression.
I tried
minimize(trace(sqrtm(sum_square_abs(x))*A))
to replace sqrt in the original, but I got the following error
Undefined function 'schur' for input arguments of type 'cvx'.
Error in sqrtm (line 32)
[Q, T] = schur(A,'complex'); % T is complex Schur form.
Error in Test_WeightNucNorm (line 35)
minimize(trace(sqrtm(sum_square_abs(x))*A))
I understand now that sqrtm() function is not implemented in CVX, so I have the error ' Undefined function 'schur' for input arguments of type 'cvx'.'. But my problem is still not solved.
I think I should use:
minimize(trace_sqrtm(sum_square_abs(x))*A)
But I still get error:
Error using cvx/trace_sqrtm (line 9)
Input must be affine.
Error in Test_WeightNucNorm (line 40)
minimize(trace_sqrtm(sum_square_abs(x))*A)
---------- Important update Thanks to @k20 , I made a mistake!! This is not the weighted nuclear norm of matrix $\mathbf{X}$, but the weighted trace of $\sqrt{\mathbf{X}^T\mathbf{X}}$!! Now my problem becomes that:how to represent the weighted nuclear norm of a matrix $\mathbf{X}$, where $\mathbf{X}$ is CVX variable, $\mathbf{A}$ is a diagonal weight matrix. I tried to find a CVX function which give me all the singular values of variable $\mathbf{X}$, but I haven't found such a function.
sqrtm(), notsqrt. – David Ketcheson Oct 24 '14 at 17:08sqrt, assqrtm()will give me a different kind of error. The background is: the nuclear norm of a matrix X is $nuc_norm(X)=trace(sqrt(X'*X))$ , but now I am not minimize the nuc_norm. – Excalibur Oct 24 '14 at 17:15norm_nuc(X*A)is not equivalent withsum(diag(sqrtm(X' X)) * diag(A)). What I need is the equivalent representation withsum(diag(sqrtm(X' X)) * diag(A)), but I haven't found a valid representation for CVX yet. – Excalibur Oct 24 '14 at 23:33