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

01-15-2014 02:22 PM

I want to solve a optimization problem where my objective function includes call of a user defined function. Since SAS do not allow us to create a user-defined function I have to use a macro to use it as if it is a function.

I am stating my problem mathematically below:

var x, y;

min z =x**2-x-2*y-x*y+y**2+function(x,y);

solve;

print x y;

function (x,y)=x+y;

Above function is very simple but it is analogous to my function which is very complicated.

So how should I do this kind of optimization in SAS using proc optmodel.

Thanks in advance for your support.

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

Posted in reply to gupta_shubham

01-15-2014 10:22 PM

If you have SAS/OR 13.1, this link should help: SAS/OR(R) 13.1 User's Guide: Calling FCMP functions from PROC OPTMODEL

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

Posted in reply to LeoLopes

01-16-2014 01:19 AM

Actually I want to use data step inside the function. And I can't use data step inside fcmp functions

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

Posted in reply to gupta_shubham

01-16-2014 09:14 AM

Do the data change in real time? If not, you might be able to load it into PROC OPTMODEL sets and arrays, write an impvar that does the same function evaluation, then use that impvar in your objective.

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

Posted in reply to LeoLopes

01-16-2014 10:06 AM

Yes data changes are required in real time. So loading data at the start of optmodel won't going to work.

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

Posted in reply to gupta_shubham

01-15-2014 11:11 PM

Does proc fcmp not let you create your own functions?