# Including inverse of matrices in the objective function

Hi all,

I am trying to solve the following optimization problem

f(X) = y'*X*y - logdet(X) + r'*X^{-1}r.

where X is symmetric and positive definite. I couldn’t add the X^{-1} term in CVX. Is there any way to add it in the objective function. I couldn’t see it in the manual. After following instructions of Bien, I tried the following. However, it showed some errors. Further I found this matrix_frac term that lets me add the r'X^{-1}r term directly

> cvx_begin sdp
>     variable X(N,N) hermitian
>     variable t
>     minimize(.5*y'*X*y - 0.5*log_det(X) + t)
>     subject to
>         X >= 0
>         [t, r'; r, X] >= 0
> cvx_end

Successive approximation method to be employed.
SDPT3 will be called several times to refine the solution.
Original size: 1618 variables, 1088 equality constraints
1 exponentials add 8 variables, 5 equality constraints
-----------------------------------------------------------------
Cones  |             Errors              |
Mov/Act | Centering  Exp cone   Poly cone | Status
--------+---------------------------------+---------
1/  1 | 8.000e+00  6.975e+00  0.000e+00 | Failed
1/  1 | 3.457e+00  6.535e-01  0.000e+00 | Failed
0/  0 | 0.000e+00  0.000e+00  0.000e+00 | Failed
0/  0 | 0.000e+00  0.000e+00  0.000e+00 | Failed
0/  0 | 0.000e+00  0.000e+00  0.000e+00 | Failed
-----------------------------------------------------------------
Status: Failed
Optimal value (cvx_optval): NaN

You can put it in epigraph form and then do a Schur complement equivalence (see, e.g., Boyd’s book, page 76):

\text{minimize}_{X,t} ~y^TXy-\log\det X+t~~~\text{s.t. }~~~\begin{pmatrix}t&r^T\\r&X\end{pmatrix}\succeq0, X\succ0.

I tried the following however cvx seems to show some error

cvx_begin sdp
variable X(N,N) hermitian
variable t
minimize(.5y’Xy - 0.5log_det(X) + t)
subject to
Q2 >= 0
[t, r’; r, Q2] >= 0
cvx_end

## Cones | Errors | Mov/Act | Centering Exp cone Poly cone | Status --------±--------------------------------±-------- 1/ 1 | 8.000e+00 6.975e+00 0.000e+00 | Failed 1/ 1 | 3.457e+00 6.535e-01 0.000e+00 | Failed 0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed 0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed 0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed

Status: Failed
Optimal value (cvx_optval): NaN

I am not sure whats going in there. Any suggestions

Ah! matrix_frac is definitely the way to go! Not sure why the approach I suggested isn’t working – I tried it and also get an error.

Looks like a failure in the successive approximation method.