In this example, SAS/IML uses graphic primitives to
position titles, axis labels, and inset text
draw and shade an irregularly shaped convex hull
draw an inset box and a line pointing to the maximum
create simple (round) numbers for axis scaling
Marine biologists need to study the relationships among population growth rate, dissolved oxygen concentration, and water temperature. Dissolved oxygen concentration and water temperature can each have an impact on the well-being of fish population in a river system.
A quadratic response surface model was used to estimate the concentration of dissolved oxygen and water temperature required to yield the maximum population growth rate. The data are population growth rates measured at three levels of oxygen and three levels of water temperature.
To compare the predictive ability of this model with the growth rates measured in the sample, compute response values from the model across a grid of points in the design space and shade in the region containing the upper quartile of model response values (the smooth convex hull is created with splines). Then superimpose the sample measurements on the design space and plot the upper quartile of sample growth rates as red dots. The display illustrates that the region around 8 mg/liter of dissolved oxygen and a water temperature of 83 degrees yields the maximum population growth rate.
The circled point indicates the maximum growth rate measured. A number of upper quartile measurements fall outside the shaded region suggesting that the quadratic model may be inadequate.
In this example, SAS/IML
invokes an optimization procedure to find local and global minima
maps function values to a color
uses graphics primitives to
create an image from a matrix of values of an objective function
position titles, axis labels, and inset text
create simple (round) numbers for axis scaling
draw two graphics windows on the same page
All the IML optimization algorithms converge toward local rather than global optima. The smallest local minimum of an objective function is called the global minimum, and the largest local maximum of an objective function is called the global maximum. Hence, the subroutines may occasionally fail to find the global optimum.
The function displayed in the image plot has a local minimum at f(1,0)=1 and a global minimum at f(4,0)=0.
![[Image: Optima]](optima2.gif)
One way to find the global minimum is to run these local optimization schemes on a grid of starting values. For example the following program calls the NLPTR subroutine with initial points xa=(0.5,1.5) and xb=(3,1); the first call finds the local optimum while the second call finds the global optimum.
proc iml;
start F_GLOBAL(x);
f=(3*x[1]**4-28*x[1]**3+84*x[1]**2-96*x[1]+64)/27 + x[2]**2;
return(f);
finish F_GLOBAL;
xa = {.5 1.5};
xb = {3 -1};
optn = {0 2};
call nlptr(rca,xra,"F_GLOBAL",xa,optn);
call nlptr(rcb,xrb,"F_GLOBAL",xb,optn);
if (rca > 0 & rcb > 0) then print xra xrb;
quit;
The module F_GLOBAL returns the value of the objective function f(x,y) at the point (x,y). RCA and RCB are codes that indicate the reason for the termination of the optimization routine; positive values indicate successful termination.
Statistics and Operations Research Home Page | SAS/IML Software