| The NLP Procedure |
lsq f1-f3;
decvar x1 x2;
jacobian j1-j6;
correspond to the Jacobian matrix
![j = [ j1 & j2 \ j3 & j4 \ j5 & j6 \ ] = [ \partial f_1/ \partial x_1 & \... ... \partial x_2 \ \partial f_3/ \partial x_1 & \partial f_3/ \partial x_2 \ ]](images/nlp_nlpeq162.gif)
For example, consider the Rosenbrock function:
proc nlp tech=levmar;
array j[2,2] j1-j4;
lsq f1 f2;
decvar x1 x2;
jacobian j1-j4;
f1 = 10 * (x2 - x1 * x1);
f2 = 1 - x1;
j[1,1] = -20 * x1;
j[1,2] = 10;
j[2,1] = -1;
j[2,2] = 0; /* is not needed */
run;
The JACOBIAN statement is useful only if more than one objective function is given in the MIN, MAX, or LSQ statement, or if a DATA= input data set specifies more than one function. If the MIN, MAX, or LSQ statement contains only one objective function and no DATA= input data set is used, the JACOBIAN and GRADIENT statements are equivalent. In the case of least-squares minimization, the crossproduct Jacobian is used as an approximate Hessian matrix.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.