1

I am trying to minimize the following expression: U and W are not important you can consider them as I

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

user2042145
  • 141
  • 1
  • 1
  • 9
  • Please be more specific than "with no success"; if there were error messages or warnings, please edit the question to include them. Please be more specific than "here is what i did"; provide the inputs for all variables before your one line of code and any nonsensical output along with the expected output. – TroyHaskin Jan 08 '16 at 18:44
  • 2
    Also, if your goal is actual symbolic optimization with general matrices, albeit assumed to be known, I'd argue that using Matlab to solve this problem is dubious at best. – TroyHaskin Jan 08 '16 at 18:45
  • I don't see any symbolic math in your question. `fmincon` is a numeric optimization routine. Please edit to clarify what you mean or remove "symbolic". More importantly, "but with no success" is not helpful. What is wrong with it? Edit to provide fully runnable code so others can try to replicate. Indicate any errors (in full) or how the output doesn't match what you expect and why? – horchler Jan 08 '16 at 20:14

1 Answers1

1

I'm going to ignore the "symbolic" part of the question. To numerically solve this problem, there are two approaches I would recommend:

Use CVX

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

Do some math and use Matlab function quadprog

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);
Matthew Gunn
  • 4,451
  • 1
  • 12
  • 30