SAS Optimization, and SAS Simulation Studio

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-03-2010 03:00 PM

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

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

/* subject to the following constraints */

/* Total resources in 2006*/

con BUDGET: sum{i in 1..3}x

solve with qp;

/* print the optimal solution */

print x 20.0;

Thank you so much for your help,

Steve Leon

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to TLNDSU

04-14-2011 02:27 AM

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

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