Operations Research topics: SAS/OR,
SAS Optimization, and SAS Simulation Studio

Using SAS's in built financial functions in PROC OPTMODEL

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

Using SAS's in built financial functions in PROC OPTMODEL

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
SAS Employee
Posts: 340

Re: Using SAS's in built financial functions in PROC OPTMODEL

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?

View solution in original post


All Replies
Solution
‎02-03-2015 08:21 AM
SAS Employee
Posts: 340

Re: Using SAS's in built financial functions in PROC OPTMODEL

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?

SAS Employee
Posts: 414

Re: Using SAS's in built financial functions in PROC OPTMODEL

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

Occasional Contributor
Posts: 8

Re: Using SAS's in built financial functions in PROC OPTMODEL

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

Occasional Contributor
Posts: 8

Re: Using SAS's in built financial functions in PROC OPTMODEL

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 320 views
  • 3 likes
  • 3 in conversation