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

- Subscribe to 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-29-2015 06:43 PM

I am trying to solve the following...

W = pX

X is an i x 1 vector of known values (i is the number of observations in my sample)

p is a constant and is negative (it is unknown).

W is an i x1 vector of unknown values.

The sum of the values in W needs to equal zero. (w1 + w2 + w3 + ...+ wi = 0)

I am trying to solve for W.

I am not sure how to set up this problem so that I can solve for W.

Is this something that I can do using proc OPTMODEL?

If so, can you please help show me how I can set it up?

If not, can you please recommend an alternative that might work?

I know that I am asking a lot but I have been struggling with this all day and any help or advice is appreciated!

I have tried using the documentation, but I am unsure of how to set up the constraints (the sum of w's is zero and that p is negative constant).

Accepted Solutions

Solution

03-30-2015
10:26 AM

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

Posted in reply to jennie

03-30-2015 10:26 AM

Yes, you can do this using PROC OPTMODEL.

If you have declared W as:

var W {1..i};

You can express the constraint that W sums to zero as follows:

con SumToZero:

sum {j in 1..i} W

To make p negative, include a slightly negative upper bound in the variable declaration:

var p <= -1e-6;

All Replies

Solution

03-30-2015
10:26 AM

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

Posted in reply to jennie

03-30-2015 10:26 AM

Yes, you can do this using PROC OPTMODEL.

If you have declared W as:

var W {1..i};

You can express the constraint that W sums to zero as follows:

con SumToZero:

sum {j in 1..i} W

To make p negative, include a slightly negative upper bound in the variable declaration:

var p <= -1e-6;

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

Posted in reply to RobPratt

04-02-2015 02:44 PM

Thanks Rob,

This is very helpful.

J