Reputation: 141
I am trying to minimize the following expression:
I am trying to minimize over x given y,x^H and A. with U and W as identity matrix.
I tried fmincon but with no success here is what i did
[B,C] = fmincon(@(X-OD).'*(X-OD)+(Ycount-A*X).'*(Ycount-A*X),0,[],[],[],[],0,inf)
Any help would be appreciated
Upvotes: 1
Views: 261
Reputation: 4519
I'm going to ignore the "symbolic" part of the question. To numerically solve this problem, there are two approaches I would recommend:
Download the package CVX. The code would be:
cvx_begin
variables x(n)
minimize(quad_form(x - xh, U_inv) + quad_form(y - A*x, W_inv))
subject to:
x >= 0
cvx_end
Doing some algebra, you can show your problem is equivalent to:
minimize (over x) .5x'(inv(U) + A'inv(W)*A)x +(-y'*inv(W)*A-xh'*inv(U))*x
subject to: x>=0
Thse you can use Matlab function quadprog
.
H = U_inv + A'*W_inv*A; %'
f = -y'*W_inv*A - xh'*U_inv;
Aeq = [];
beq = [];
LB = zeros(n, 1);
UB = [];
x_method2 = quadprog(H, f, [], [], Aeq, beq, LB, UB);
Upvotes: 1