From: Eunju Lee on 17 Apr 2010 06:26 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 17 Apr 2010 09:23 > > 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 19 Apr 2010 13:50 "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
|
Pages: 1 Prev: wind turbine parameters Next: norn-constrained portfolio optimization |