BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JANET1987
Obsidian | Level 7

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

Yes. I think so . 

You can easily define it as

 

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

View solution in original post

5 REPLIES 5
Ksharp
Super User

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.

JANET1987
Obsidian | Level 7

Hello, 

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

JANET1987
Obsidian | Level 7

Hello, 

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

thank you in advance 

Ksharp
Super User

Yes. I think so . 

You can easily define it as

 

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

JANET1987
Obsidian | Level 7

Great!!! Thank you so much! Smiley Happy

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 5 replies
  • 1639 views
  • 2 likes
  • 2 in conversation