From: Eunju Lee on
Hello,

i am trying to solve norm-constrained minimum variance portfolio optimization using fmincon function, but haven't figured out how i put the norm constraint into function.
my objective function is:

min(w) w'*C*w
s.t sum(w)=1
sum of abs(w)<=c

so here is my question, how put the 'sum of abs(w)' into fmincon function line?
is there anyone who knows this, pls. hlep me
From: Bruno Luong on
>
> so here is my question, how put the 'sum of abs(w)' into fmincon function line?
> is there anyone who knows this, pls. hlep me

Assuming w is a vector of R^n
sum(abs(w)) <= c is equivalent (1-norm "ball") is equivalent to 2^n linear constraints

sum over i (a(i)*w(i)) <= c

where {a} are all vectors of {-1,1}^n.

In practice you should add the matrix the linear constraints A*w <= b, in fmincon where A and b are defined as

a={[-1 1]}
n=length(w)
c =... something

A = cell(1,n);
[A{:}]=ndgrid(a{ones(1,n)});
A=reshape(cat(n+1,A{:}),[],n)
b = c+zeros(2^n,1)

% Bruno
From: Eunju Lee on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hqccno$6lo$1(a)fred.mathworks.com>...
> >
> > so here is my question, how put the 'sum of abs(w)' into fmincon function line?
> > is there anyone who knows this, pls. hlep me
>
> Assuming w is a vector of R^n
> sum(abs(w)) <= c is equivalent (1-norm "ball") is equivalent to 2^n linear constraints
>
> sum over i (a(i)*w(i)) <= c
>
> where {a} are all vectors of {-1,1}^n.
>
> In practice you should add the matrix the linear constraints A*w <= b, in fmincon where A and b are defined as
>
> a={[-1 1]}
> n=length(w)
> c =... something
>
> A = cell(1,n);
> [A{:}]=ndgrid(a{ones(1,n)});
> A=reshape(cat(n+1,A{:}),[],n)
> b = c+zeros(2^n,1)
>
> % Bruno

Hi Bruno,
many thaks for your reply, actually what you wrote is not completely clear to me :p
but i think i getting something..
will try it again..
EJ Lee