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

02-03-2015 06:09 AM

Hi,

I am using PROC OPTMODEL to optimize interest rate 'i' . The objective function tries to maximize cash flows that are calculated using different in built SAS functions such as CUMPRINC which take 'i' as one of its input parameters. The result on running the PROC is that it is not able to calculate the initial value of the objective function. After playing around a bit we realized that the reason for it might be that CUMPRINC cannot be called from within OPTMODEL. Is there a specific syntax to call functions like CUMPRINC from within OPTMODEL?

Thanks,

Parikshit

Accepted Solutions

Solution

02-03-2015
08:21 AM

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

Posted in reply to Parixit

02-03-2015 08:21 AM

An example that runs in SAS/OR 13.1 (only syntactically correct):

proc optmodel;

var rate init 0.09/12;

max xx=cumprinc(rate, 360, 125000, 12, 24, 0) - cumprinc(rate, 300, 125000, 12, 24, 0);

solve;

put rate;

quit;

What did you try? What is the version of SAS/OR you are using?

All Replies

Solution

02-03-2015
08:21 AM

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

Posted in reply to Parixit

02-03-2015 08:21 AM

An example that runs in SAS/OR 13.1 (only syntactically correct):

proc optmodel;

var rate init 0.09/12;

max xx=cumprinc(rate, 360, 125000, 12, 24, 0) - cumprinc(rate, 300, 125000, 12, 24, 0);

solve;

put rate;

quit;

What did you try? What is the version of SAS/OR you are using?

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

Posted in reply to gergely_batho

02-03-2015 09:45 AM

As Gergely points out, the financial functions are supported in PROC OPTMODEL. And the documentation contains such an example:

SAS/OR(R) 13.2 User's Guide: Mathematical Programming Examples

I recommend one of the following remedies:

1. trying different initial values for the variables used in the function

2. using the MULTISTART option in the SOLVE WITH NLP statement: SAS/OR(R) 13.2 User's Guide: Mathematical Programming

3. using the NOINITVAR option in the PROC OPTMODEL statement: SAS/OR(R) 13.2 User's Guide: Mathematical Programming

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

Posted in reply to RobPratt

02-04-2015 04:05 AM

Thanks Rob. I was submitting infeasible paramters to CUMPRINC via a loop.

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

Posted in reply to gergely_batho

02-04-2015 04:04 AM

Thank you Gergely. Turns out something was wrong with the parameters being submitted for CUMPRINC. Thanks for the help.