Statistical programming, matrix languages, and more

portfolio optimization under nonlinear constraint

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

portfolio optimization under nonlinear constraint

Hello, 

 

In this program I’m trying to maximize portfolio skewness under constraints.

Nevertheless , I have one more problem. In my case, I have one linear constraint and one Nonlinear constraint (quartic constraint about portfolio kurtosis which is less than a scalar). As I understand while reading  chapter 14 about Nonlinear optimization examples, I must use NLPQN instead of NLPNRA! IS that sufficient?

In the other hand, I still think about the mining of “optn”! and if x0 must take always only two initial values?

Finally, I want to state decision variables wi as positive, I question whether it been subject to a further constraint.

Sorry for those lots of questions. Thank you in advance! 

 

proc iml;

M3 = {32 -7 -7 -8,

      -7 -8 -8 17};

 

start skpf(p) global(M3);

   w = p`;   /* w is column vector */

   return w` * M3 * (w@w);

finish;

 

/* specify linear constraints  */

con = { 0  0  .   .,  /* min w[i]   */

        1  1  .   .,  /* max w[i]   */

        1  1  0   1}; /* sum(w) = 1 */

x0 = {0.5 0.5};

optn = {1    /* maximize objective function */

        1 }; /* summarize iteration history */

call nlpnra(rc, xOpt, "skpf", x0, optn, con);

maxVal = skpf(xOpt);

print rc, xOpt maxVal;


Accepted Solutions
Solution
‎10-11-2016 10:47 AM
Grand Advisor
Posts: 9,596

Re: portfolio optimization under nonlinear constraint

Yes. I think so . 

You can easily define it as

 

x0=j{1,500,1}/500;

View solution in original post


All Replies
Grand Advisor
Posts: 9,596

Re: portfolio optimization under nonlinear constraint

Yes. If you have nonlinear constraint , you have to switch into NLPQN.

 

if you have three assets , then you have to have three initial value for x0.

 

con={} already constraint    0<= w1 ,w2 <=1,

if you have nonlinear constrain condition,you need add one more option in it.

Occasional Contributor
Posts: 12

Re: portfolio optimization under nonlinear constraint

Hello, 

Thank you very much! Your recommandations are highly appreciated. I'm still trying to solve the problem. 

Occasional Contributor
Posts: 12

Re: portfolio optimization under nonlinear constraint

Hello, 

Sorry, but what about if I have 500 assets, should I have 500 initial values for X0? 

thank you in advance 

Solution
‎10-11-2016 10:47 AM
Grand Advisor
Posts: 9,596

Re: portfolio optimization under nonlinear constraint

Yes. I think so . 

You can easily define it as

 

x0=j{1,500,1}/500;

Occasional Contributor
Posts: 12

Re: portfolio optimization under nonlinear constraint

Great!!! Thank you so much! Smiley Happy

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 398 views
  • 2 likes
  • 2 in conversation