BookmarkSubscribeRSS Feed
TLNDSU
Calcite | Level 5
Hello,

I am having trouble with coming up with the correct code to find VaR and
the optimal solution using proc optmodel. I have attached below the code I am using for a mean/variance approach to the optimal solution, but I'd like to use the mean/VaR approach as well. The code includes the expected returns and the
covariance matrix.

Could anyone help me in modifying my code to include finding VaR at the .05 level and to find the optimal allocation to each region?

proc optmodel;
/* x1, x2, x3 amount of available resources allocated to each of the three
region */
var x{1..3} >= 0;

num coeff{1..3, 1..3} = [0.0168011611 0.0164661727 0.0179412346
0.0164661727 0.0254631245 0.0178165208
0.0179412346 0.0178165208 0.0289536036];

num r{1..3}=[-0.0903476 -0.1342186 -0.1498193];

/* Minimize variance */
min f = sum{i in 1..3, j in 1..3} coeff[i,j]*x*x;

/* subject to the following constraints */
/* Total resources in 2006*/
con BUDGET: sum{i in 1..3}x = 56288890475;

solve with qp;

/* print the optimal solution */
print x 20.0;

Thank you so much for your help,

Steve Leon
1 REPLY 1
goladin
Calcite | Level 5
Hi Steve,

I am not exactly sure what you are doing in the codes but I cannot find the expected return statement/constraint anywhere. Can you advise me on your product list as I think VAR should be computed external of this optimization run.

Regards,
Murphy

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Discussion stats
  • 1 reply
  • 802 views
  • 0 likes
  • 2 in conversation