Chapter Contents |
Previous |
Next |
The NLIN Procedure |
The analysis may also take excessive time if your problem takes many iterations to converge since each iteration requires as much time as a linear regression with predicted values and residuals calculated.
parms b0=0 b1=.022; model pop=b0*exp(b1*(year-1790)); der.b0=exp(b1*(year-1790)); der.b1=(year-1790)*b0*exp(b1*(year-1790));
The first iteration changes a subset of the parameters; then the procedure can make progress in succeeding iterations. This singularity problem is local. The next example displays a global problem.
You may have a term b2 in the exponent that is nonidentifiable since it trades roles with b0.
parms b0=3.9 b1=.022 b2=0; model pop=b0*exp(b1*(year-1790)+b2); der.b0=exp(b1*(year-1790)+b2); der.b1=(year-1790)*b0*exp(b1*(year-1790)+b2); der.b2=b0*exp(b1*(year-1790)+b2);
PROC NLIN failed to converge
and displays the results. This often means that the procedure has not converged at all. If you provided the derivatives, check them very closely and then check the sum-of-squares error surface before proceeding. If PROC NLIN has not converged, try a different set of starting values, a different METHOD= specification, the G4 option, or a different model.
parms b=0; model y=x / b;
Suppose that y happens to be all zero and x is nonzero. There is no least squares estimate for b since the SSE declines as b approaches infinity or minus infinity. The same model could be parameterized with no problem into y = a*x.
If you have divergence problems, try reparameterizing, selecting different starting values, increasing the maximum allowed number of iterations (the MAXITER= option), specifying an alternative METHOD= option, or including a BOUNDS statement.
parms a=1 b=-1; model y=(1-a*x)*(1-b*x);
Once a solution is found, an equivalent solution with the same SSE can be obtained by swapping the values of a and b.
model y=a+int(b*x); model y=a+b*x+4*(z>c);
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.