BookmarkSubscribeRSS Feed
Emara
Calcite | Level 5

Hello all;

I am running a SAS (PROC IML) NLPNMS constrained optimization program.  I have three parameters in my model and I want to minimize the objective function. I got some results that seem good and I compared my results to other results.

I was asked the following question about my results "there are three prameters to be determined. What is the computational efficiency and acuracy? the computatinal accuracy affects the comparisons".

Actually,I am not sure about the meaning of that question or its answer. Coud you help please.

Aya

4 REPLIES 4
Hutch_sas
SAS Employee

There are many different ways tolook at computational efficiency. The Nelder-Mead simplex algorithm, because it does not use gradients directly, may require more objective function evaluations than some other techniques such as the conguate gradient method. However, the computation of gradients and Hessians can sometimes be very cpu-intensive themselves, so the least cpu-intensive method generally depends on the problem constraints and objective function.

There are also several ways to estimate the accuracy of the results. Look at the SAS/IML doc under Nonlinear Optimization Examples->Details->Termination Criteria. IML provides several options for terminating the optimization process for NLPNMS, based on the relative or absolute change in value of either the objective function or the parameters between iterations of the algorithm, and that should give you some estimate of the accuracy of the results. Obviously, the tighter the termination criteria, the more iterations will be required. Since your input data or model iteslf is probably not exact in the first place, requiring extreme accuracy may not be justified and can lead to excessive run times or numerical problems. Keep in mind also that all the nlp methods will converge to a local optimum, so unless your objective function is complex it is possible that your answer might not always be the global one.

Emara
Calcite | Level 5

Thank you so much for your reply. I am using SAS 9.0. I want to check that the termination criteria defaults for the NLPNMS subroutine are the same as those of later SAS versions. In the SAS IML Non-linear Optimization document, I found that the default for the "absolute parameter convergence criterion(ABSXTOL)," is 1E-08 and However, when running my code I got this:

                                                                                                                              Nelder-Mead Simplex Optimization                                

                                                                                                                          COBYLA Algorithm by M.J.D. Powell (1992)                            

                                                                                                                                                                                                

                    Minimum Iterations                                     0                    

                    Maximum Iterations                                  1000                    

                    Maximum Function Calls                              3000                    

                    Iterations Reducing Constraint Violation               0                    

                    ABSFCONV Function Criterion                            0                    

                    FCONV Function Criterion                    2.220446E-16                    

                    FCONV2 Function Criterion                           1E-6                    

                    FSIZE Parameter                                        0                    

                    ABSXCONV Parameter Change Criterion               0.0001                    

                    XCONV Parameter Change Criterion                       0                    

                    XSIZE Parameter                                        0                    

                    ABSCONV Function Criterion                  -1.34078E154                    

                    Initial Simplex Size (INSTEP)                        0.5                    

                    Singularity Tolerance (SINGULAR)                    1E-8   

Does this mean that the absolute parameter convergence criterion (which is now called  ABSXCONV) is 0.0001 not 1E-08?!. I didn't change the defaults at all, so why are the termination criteria different?? Is ABSXCONV the same as ABSXTOL?? I am really confused!!

Aya

Hutch_sas
SAS Employee

The other default values seem to be in line with the 9.1 doc, so there could be an error in the documentation regarding that parameter. It might be helpful if you shared your program, to verify your setup for the optimization.

Emara
Calcite | Level 5

Hello...

Here is my SAS program. I want to point out that it is not only the termination criteria values that differ from the SAS documentation, but their names also ( ABSXCONV versus ABSXTOL)

prociml;

  start ARL(hr);

shift=5;

   m=100;

  t=2*m+1;

  delta=2*hr[1]/t;

   z=-hr[1]+.5*delta;

do i=2 to t;

  k=-hr[1]+(i-.5)*delta;

  z=z//k;

  end;

        do i=1 to t;

         zz=0;

                do j=1 to t;

                 tau1=z[j, ]+(delta/2)-z[i,];

               tau2=z[j, ]-(delta/2)-z[i,];

  if tau1<-(hr[2]*hr[3])then fun1=tau1-(1-hr[2])*hr[3];

     if abs(tau1)<=(hr[2]*hr[3])then fun1=tau1/hr[2];

    if tau1>(hr[2]*hr[3])then fun1=tau1+(1-hr[2])*hr[3];

   if tau2<-(hr[2]*hr[3])then fun2=tau2-(1-hr[2])*hr[3];

   if abs(tau2)<=(hr[2]*hr[3])then fun2=tau2/hr[2];

   if tau2>(hr[2]*hr[3])then fun2=tau2+(1-hr[2])*hr[3];

                kone=z[i,]+fun1;

                ktwo=z[i,]+fun2;

             pij=probnorm(kone-shift)-probnorm(ktwo-shift);

             zz=zz//pij;

              end;

         if i=1 then r=zz;

         else

       r=r||zz;

         end;

    v=j(t,1,0);

         v[((t+1)/2),]=1;

     
v=t(v);

  r=r[2:t+1,];

  r=t(r);

  avrl=inv((I(t)-r))*j(t,1,1);

  bb=(v*avrl);

  return(bb);

  finish;

   start ARL0(hr);

  m1=100;

  shift=0;

  bb0=j(1,1,0.);

  t1=2*m1+1;

  delta1=2*hr[1]/t1;

  z1=-hr[1]+.5*delta1;

  do i1=2 to t1;

  k1=-hr[1]+(i1-.5)*delta1;

  z1=z1//k1;

  end;

  do i1=1 to t1;

        zz1=0;

                do j1=1 to t1;

                 tau11=z1[j1, ]+(delta1/2)-z1[i1,];

                tau21=z1[j1, ]-(delta1/2)-z1[i1,];

  if tau11<-(hr[2]*hr[3])then fun11=tau11-(1-hr[2])*hr[3];

  if abs(tau11)<=(hr[2]*hr[3])then fun11=tau11/hr[2];

   if tau11>(hr[2]*hr[3])then fun11=tau11+(1-hr[2])*hr[3];

if tau21<-(hr[2]*hr[3])then fun21=tau21-(1-hr[2])*hr[3];

   if abs(tau21)<=(hr[2]*hr[3])then fun21=tau21/hr[2];

   if tau21>(hr[2]*hr[3])then fun21=tau21+(1-hr[2])*hr[3];

           kone1=z1[i1,]+fun11;

           two1=z1[i1,]+fun21;

           pij1=probnorm(kone1-shift)-probnorm(ktwo1-shift);

                zz1=zz1//pij1;

                end;

        if i1=1 then r1=zz1;

         else

         r1=r1||zz1;

        end;

  v1=j(t1,1,0);

        v1[((t1+1)/2),]=1;

       v1=t(v1);

  r1=r1[2:t1+1,];

  r1=t(r1);

  avrl1=inv((I(t1)-r1))*j(t1,1,1);

  bb0[1]=1000-(v1*avrl1);

  return(bb0);

  finish;

  con = {   0    0    0

                   .    1    .    };

  hr={2.015  0.354  1.989}; 

  optn= j(1,11,.);optn[2]=5;optn[10]=1;optn[11]=0;

  CALL NLPNMS(rc,hrres,"ARL",hr) blc=con opt=optn nlc="ARL0";

  quit;



sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 4 replies
  • 1257 views
  • 6 likes
  • 2 in conversation