Examples (NLR command)

MODEL PROGRAM A=.5 B=1.6.
COMPUTE PRED=A*SPEED**B.

DERIVATIVES.
COMPUTE D.A=SPEED**B.
COMPUTE D.B=A*LN(SPEED)*SPEED**B.

NLR STOP.
  • MODEL PROGRAM assigns values to the model parameters A and B.
  • COMPUTE generates the variable PRED to define the nonlinear model using parameters A and B and the variable SPEED from the active dataset. Because this variable is named PRED, the PRED subcommand is not required on NLR.
  • DERIVATIVES indicates that calculations for derivatives are being supplied.
  • The two COMPUTE statements on the DERIVATIVES transformations list calculate the derivatives for the parameters A and B. If either parameter had been omitted, NLR would have calculated it numerically.
  • NLR specifies STOP as the dependent variable. It is not necessary to specify SPEED as the independent variable because it has been used in the model and derivatives programs.