Quadratic programing problem and MATLAB

175 Views Asked by At

I have a little problem with quadratic programing problem:

${\bf v}^T \Sigma {\bf v} \rightarrow min $,

and constrains are $ {\bf v}^T \mu = \mu_*, {\bf v}^T {\bf 1 }= 1, 0 \leq {\bf v}. $

Where v is vector and $\Sigma$ is matrix.

I know that Lagrange function should be: $ L( {\bf v }, \bar{\tau}, \bar{\gamma}, \bar{\lambda} ) = {\bf v }^T \Sigma {\bf v } - \bar{\tau}^T {\bf v } {\bf \mu }_* -\bar{\gamma}({\bf v }^T {\bf \mu } - {\bf \mu }_*) - \bar{\lambda} ({\bf v }^T {\bf 1 } - 1). $

And KKT (Kuhn-Tucker-Karush) conditions then:

$ 0 = 2 \Sigma {\bf v } - \bar{\tau} - \bar{\gamma} {\bf \mu } - \bar{\lambda} {\bf 1 } $

$ {\bf \mu }_* = {\bf v }^T {\bf \mu } $

$ 1 = {\bf v }^T {\bf 1 } $

$ 0 \le \bar{\tau} $

$ 0 \ge - {\bf v }$

$ 0 = - \bar{\tau} {\bf v }.$

I have a problem to make a formulation of any poblem, but for example a problem: :

$ \Sigma = \begin{pmatrix} 0.1 & 0.15 \\ 0.15 & 0.2\\ \end{pmatrix} $

$ v_1 + v_2 = 1 $

$ 0.2*v_1 + 0.3*v_2 = 0.25 $

$ v_1, v_2 \ge 0 $

So my biggest problem its that I want to obtain solution and also the values of multiplikators. Can somenone help me plsease ?

I tried lot of matlab functions: quadprog, fmincon. but everytime some error occured or some conditions wasnt satisfied.

I think the best way is to make it linear problem accordig to KKT conditions and then use linprog in MATLAB but i dont know how to formulate it, please help. Thanks !

1

There are 1 best solutions below

0
On

You could solve this directly with quadprog:

>> S=[0.1 0.15; 0.15 0.2];
>> Aeq=[1 1; 0.2 0.3];
>> beq=[1;0.25];
>> lo=[0;0];
>> [x,fval,exitflag,output,lambda] = quadprog(2*S,[],[],[],Aeq,beq,lo,[]);

Minimum found that satisfies the constraints.

Optimization completed because the objective function is non-decreasing in 
feasible directions, to within the default value of the function tolerance,
and constraints are satisfied to within the default value of the constraint tolerance.

<stopping criteria details>

>> x

x =

    0.5000
    0.5000

>> lambda.eqlin

ans =

   -0.0500
   -1.0000