where R_hat is a constant matrix,

*a*is constant vector consisting matrix A ; R is calculated by

*a*and matrix P=diag(

*p*), that is R = A’*diag(

*p*)*A

my code is: I cannot obtain the right result,who can help me?

```
cvx_begin sdp quiet
variable p(1,length(A))
expressions w(length(A),1) complex
expressions R(M,M) complex
R = (A'*diag(p)*A);
minimize trace_inv(inv_R_hat*R*inv_R_hat)
subject to
w =conj(diag(A*inv_hat*A'))/M;
1 == p*w ;
cvx_end
```

I cannot obtain the right result,who can help me?

the SPICE is from SPICE: a sparse covariance-based estimation method for array processing