## 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;

1 ACCEPTED SOLUTION

Accepted Solutions  Ksharp
Super User

## Re: portfolio optimization under nonlinear constraint

Yes. I think so .

You can easily define it as

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

5 REPLIES 5  Ksharp
Super User

## 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.

## Re: portfolio optimization under nonlinear constraint

Hello,

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

## Re: portfolio optimization under nonlinear constraint

Hello,

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

## Re: portfolio optimization under nonlinear constraint

Yes. I think so .

You can easily define it as

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

## Re: portfolio optimization under nonlinear constraint

Great!!! Thank you so much! From The DO Loop