I want to know if there is any way to optimize a function with two variables other than using the newton raphson method in SAS/IML

Reply
Occasional Contributor
Posts: 5

I want to know if there is any way to optimize a function with two variables other than using the newton raphson method in SAS/IML

I have been trying to minimize the distance between two parameters mean & standard deviation and their corresponding start empirical values using a dist function and then optimize it using various optimization techniques like NLPNMS, NLPNRA, NLPTR etc.

Kindly let me know of any other method which is available in SAS/IML to do so. Thank you.

con = { 1.e-6 1.e-6,  . .};

blc=j(2,2,.);

opt={0,4};

m = {288827.949 0.385871529};

CALL NLPNRA(rc,x,"dist",m,opt,blc=con);

print x;

SAS Super FREQ
Posts: 3,475

Re: I want to know if there is any way to optimize a function with two variables other than using the newton raphson method in SAS/IML

Yes, and you name a few of the alternate methods. The chapter "Nonlinear Optimization Examples" in the SAS/IML Users Guide has many examples that use trust regions, double-dogleg, etc.

BTW, your call to NLPNRA has an error.  If you specify the BLC= option, put it OUTSIDE the closing parentheses:

CALL NLPNRA(rc,x,"dist",m,opt) blc=con;

or just use

CALL NLPNRA(rc,x,"dist",m,opt,con);

Occasional Contributor
Posts: 5

Re: I want to know if there is any way to optimize a function with two variables other than using the newton raphson method in SAS/IML

Thanks for the response...I know of the NLPNRA method....I want to know if there is any method other than that for optimizing two variables at a time..as NLPNRA method is not giving me quite optimized results as intended. Also NLPNRA returns me just one scalar value whereas I need to get two optimized values for the two input values I am giving to the function.

Output returns me :  x = -5

Occasional Contributor
Posts: 5

Re: I want to know if there is any way to optimize a function with two variables other than using the newton raphson method in SAS/IML

Can you kindly reply soon? It's kind of urgent. Thank you.

SAS Super FREQ
Posts: 3,475

Re: I want to know if there is any way to optimize a function with two variables other than using the newton raphson method in SAS/IML

I don't understand your follow-up question.  What more information are you looking for? doc shows all of the optimization methods that are built into SAS/IML.

Occasional Contributor
Posts: 5

Re: I want to know if there is any way to optimize a function with two variables other than using the newton raphson method in SAS/IML

I am looking for such an optimization function which optimizes two variables at the same time and returns the optimized values of the two variables together but none of the optimization methods listed in the doc does that....so I want to know if there is any such optimization method which does optimization of two variables together as given as input in my matrix m. Reply soon

Occasional Contributor
Posts: 5

Re: I want to know if there is any way to optimize a function with two variables other than using the newton raphson method in SAS/IML

Can you reply a bit quicker as I need it urgently for some work?

SAS Super FREQ
Posts: 3,475

Re: I want to know if there is any way to optimize a function with two variables other than using the newton raphson method in SAS/IML

I still don't understatnd.  The NLP functions enable you to optimize as many parameters as you want. Maybe you should give an example of what you are trying to do.  (Also, you'd get faster response if this were posted in a sub-forum such as the SAS/IML Support Community.)

Ask a Question
Discussion stats
  • 7 replies
  • 382 views
  • 0 likes
  • 2 in conversation