BookmarkSubscribeRSS Feed
surro
Calcite | Level 5

Hi community,

I'm running a non-linear optimization in IML using NLPDD using two parameters, and would like to compare the final objective function values for many different sets of initial values (500 or so) by plotting the value as a surface.

Can anyone recommend whether the best approach is to run my optimization many times and produce a plot using the result, or to try and create the plot directly from the function itself?

If it's better to run the optimization many times, can anyone suggest a way to store the final value of the objective function in a dataset (with respective initial values), so I can leave it to run in a loop without having to check the output window after each run?

Thanks

1 REPLY 1
Rick_SAS
SAS Super FREQ

Assuming that the function has K maxima, I think that a "heat map" is a way to go.  For each initial condition, the NLP routine will converge to one of the K extrema. Label them 1, 2, 3,...K and assign them different colors. Then make a scatter plot of the inial conditions, and color each point by the extremum that it converged to.

To be concrete, suppose that your function has three maximums: m1, m2, and m3, and that you've identified these location. You choose a bunch of initial conditions on a rectangular grid and record which max each one converges to. For example, on a 11x11 integer grid, do the following:

x=.; y=.; m=.;

create results var {x y m};

do x = -5 to 5;

   do y = -5 to 5;

   /** use NLP function to find optimum, z **/

   /** if z is near m1, then m=1;

       if z is near m2, then m=2; etc; **/

      append;

   end;

end;

close results;

PROC SGPLOT data=results;

scatter x=x y=x / group=m;

run;

I have not verified that the previous code compiles/runs, but I hope this gets you started.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 1193 views
  • 0 likes
  • 2 in conversation