home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / math / nonlin24.zip / NONLIN.DOC < prev    next >
Text File  |  1993-06-30  |  122KB  |  2,508 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                    N O N L I N
  7.  
  8.  
  9.  
  10.                       Nonlinear Regression Analysis Program
  11.  
  12.  
  13.  
  14.  
  15.                                Phillip H. Sherrod
  16.  
  17.               Member, Association of Shareware Professionals (ASP)
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.            Nonlin  allows  you  to  perform   statistical   regression
  25.            analyses  to  estimate the values of parameters for linear,
  26.            multivariate,  polynomial,   logistic,   exponential,   and
  27.            general   nonlinear  functions.   The  regression  analysis
  28.            determines the values of the  parameters  which  cause  the
  29.            function  to  best  fit the observed data that you provide.
  30.            Nonlin allows you to specify the function whose  parameters
  31.            are  being estimated using ordinary algebraic notation.  In
  32.            addition to determining  the  parameter  estimates,  Nonlin
  33.            can  be  directed to generate an output file with predicted
  34.            values  and  residuals.   It  can  also   plot   the   data
  35.            observations  and the computed function.  Although designed
  36.            for regression analysis, Nonlin can also be  used  to  find
  37.            the  root  (zero  point)  or  minimum  absolute  value of a
  38.            nonlinear  expression.   Nonlin   is   in   use   at   many
  39.            engineering and research centers around the world.
  40.  
  41.  
  42.  
  43.  
  44.  
  45.                                 Table of Contents
  46.  
  47.  
  48.  
  49.        1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 1
  50.          1.1 Introduction to Regression Analysis . . . . . . . . . . . . 1
  51.          1.2 Introduction to Nonlin  . . . . . . . . . . . . . . . . . . 2
  52.          1.3 Installing Nonlin . . . . . . . . . . . . . . . . . . . . . 3
  53.  
  54.        2. Using Nonlin . . . . . . . . . . . . . . . . . . . . . . . . . 5
  55.          2.1 Function Specification  . . . . . . . . . . . . . . . . . . 6
  56.            2.1.1 Arithmetic Operators  . . . . . . . . . . . . . . . . . 6
  57.            2.1.2 Numeric Constants . . . . . . . . . . . . . . . . . . . 6
  58.            2.1.3 Symbolic Constants  . . . . . . . . . . . . . . . . . . 6
  59.            2.1.4 Built-in Constants  . . . . . . . . . . . . . . . . . . 6
  60.            2.1.5 Built-in Functions  . . . . . . . . . . . . . . . . . . 7
  61.          2.2 Nonlin Command Files  . . . . . . . . . . . . . . . . . . . 9
  62.  
  63.        3. Nonlin Commands  . . . . . . . . . . . . . . . . . . . . . .  11
  64.          3.1 TITLE . . . . . . . . . . . . . . . . . . . . . . . . . .  11
  65.          3.2 VARIABLES . . . . . . . . . . . . . . . . . . . . . . . .  11
  66.          3.3 PARAMETERS  . . . . . . . . . . . . . . . . . . . . . . .  11
  67.          3.4 CONFIDENCE  . . . . . . . . . . . . . . . . . . . . . . .  12
  68.          3.5 CONSTANT  . . . . . . . . . . . . . . . . . . . . . . . .  12
  69.          3.6 CONSTRAIN . . . . . . . . . . . . . . . . . . . . . . . .  13
  70.          3.7 COVARIANCE  . . . . . . . . . . . . . . . . . . . . . . .  13
  71.          3.8 SWEEP . . . . . . . . . . . . . . . . . . . . . . . . . .  13
  72.          3.9 FUNCTION  . . . . . . . . . . . . . . . . . . . . . . . .  14
  73.          3.10 TOLERANCE  . . . . . . . . . . . . . . . . . . . . . . .  14
  74.          3.11 ITERATIONS . . . . . . . . . . . . . . . . . . . . . . .  14
  75.          3.12 REGISTER . . . . . . . . . . . . . . . . . . . . . . . .  15
  76.          3.13 OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . .  15
  77.          3.14 POUTPUT  . . . . . . . . . . . . . . . . . . . . . . . .  16
  78.          3.15 PLOT . . . . . . . . . . . . . . . . . . . . . . . . . .  16
  79.          3.16 RPLOT  . . . . . . . . . . . . . . . . . . . . . . . . .  17
  80.          3.17 NPLOT  . . . . . . . . . . . . . . . . . . . . . . . . .  18
  81.          3.18 PRESOLUTION  . . . . . . . . . . . . . . . . . . . . . .  19
  82.          3.19 WIDTH  . . . . . . . . . . . . . . . . . . . . . . . . .  19
  83.          3.20 NOECHO . . . . . . . . . . . . . . . . . . . . . . . . .  19
  84.          3.21 DATA . . . . . . . . . . . . . . . . . . . . . . . . . .  19
  85.  
  86.        4. Understanding The Results  . . . . . . . . . . . . . . . . .  21
  87.          4.1 Descriptive Statistics for Variables  . . . . . . . . . .  21
  88.          4.2 Parameter Estimates . . . . . . . . . . . . . . . . . . .  21
  89.          4.3 t Statistic . . . . . . . . . . . . . . . . . . . . . . .  21
  90.          4.4 Prob(t) . . . . . . . . . . . . . . . . . . . . . . . . .  22
  91.          4.5 Final Sum of Squared Deviations . . . . . . . . . . . . .  22
  92.          4.6 Average and Maximum Deviation . . . . . . . . . . . . . .  22
  93.          4.7 Proportion of Variance Explained  . . . . . . . . . . . .  22
  94.          4.8 Adjusted Coefficient of Multiple Determination  . . . . .  23
  95.          4.9 Durbin-Watson Statistic . . . . . . . . . . . . . . . . .  23
  96.  
  97.  
  98.                                         i
  99.  
  100.        Contents                                                         ii
  101.  
  102.  
  103.          4.10 Analysis of Variance Table . . . . . . . . . . . . . . .  24
  104.  
  105.        5. Theory of Operation  . . . . . . . . . . . . . . . . . . . .  25
  106.          5.1 Minimization Algorithm  . . . . . . . . . . . . . . . . .  25
  107.          5.2 Convergence Criterion . . . . . . . . . . . . . . . . . .  25
  108.  
  109.        6. Hints for Nonlin Use . . . . . . . . . . . . . . . . . . . .  27
  110.          6.1 Convergence Failures  . . . . . . . . . . . . . . . . . .  27
  111.          6.2 Singular Matrix Problems  . . . . . . . . . . . . . . . .  28
  112.          6.3 Performance Issues  . . . . . . . . . . . . . . . . . . .  28
  113.          6.4 Program Limits  . . . . . . . . . . . . . . . . . . . . .  29
  114.  
  115.        7. Example Analyses . . . . . . . . . . . . . . . . . . . . . .  30
  116.  
  117.        8. Special Applications . . . . . . . . . . . . . . . . . . . .  33
  118.          8.1 Omitted Dependent Variable  . . . . . . . . . . . . . . .  33
  119.          8.2 Root Finding and Expression Minimization  . . . . . . . .  35
  120.            8.2.1 Function Minimization Examples  . . . . . . . . . . .  36
  121.  
  122.        9. Acknowledgement and Use of Nonlin  . . . . . . . . . . . . .  38
  123.          9.1 Acknowledgement . . . . . . . . . . . . . . . . . . . . .  38
  124.          9.2 Use and Distribution of Nonlin  . . . . . . . . . . . . .  38
  125.          9.3 Association of Shareware Professionals  . . . . . . . . .  39
  126.          9.4 Copyright Notice  . . . . . . . . . . . . . . . . . . . .  39
  127.          9.5 Disclaimer  . . . . . . . . . . . . . . . . . . . . . . .  39
  128.  
  129.        10. Other Software  . . . . . . . . . . . . . . . . . . . . . .  40
  130.          10.1 Mathplot -- Mathematical Function Plotting Program . . .  40
  131.          10.2 TSX-32 -- Multi-User Operating System  . . . . . . . . .  40
  132.          10.3 SIMSTAT -- Interactive Statistics Program  . . . . . . .  41
  133.  
  134.        11. Software Order Form . . . . . . . . . . . . . . . . . . . .  42
  135.  
  136.        Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  43
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.                                     Chapter 1
  144.  
  145.                                   Introduction
  146.  
  147.  
  148.  
  149.  
  150.        1.1 Introduction to Regression Analysis
  151.  
  152.        The  goal  of  regression  analysis  is  to determine the values of
  153.        parameters for a function that cause the function  to  best  fit  a
  154.        set  of  data observations that you provide.  In linear regression,
  155.        the function is a linear (straight line)  equation.   For  example,
  156.        if  we  assume  the  value of an automobile decreases by a constant
  157.        amount each year after its purchase, and for each mile driven,  the
  158.        following  linear  function  would predict its value (the dependent
  159.        variable) as a function of the two independent variables which  are
  160.        age and miles:
  161.  
  162.             value = price + depage*age + depmiles*miles
  163.  
  164.        where  'value',  the  dependent  variable, is the value of the car,
  165.        'age' is the age of the car, and 'miles' is  the  number  of  miles
  166.        that the car has been driven.
  167.  
  168.        The  regression  analysis  performed  by  Nonlin will determine the
  169.        best values of the three parameters, 'price', the  estimated  value
  170.        when  age  is  0  (i.e.,  when  the  car  was  new),  'depage', the
  171.        depreciation that  takes  place  each  year,  and  'depmiles',  the
  172.        depreciation  for  each  mile  driven.   The values of 'depage' and
  173.        'depmiles' will be negative because the car loses value as age  and
  174.        miles increase.
  175.  
  176.        In  a  problem  such  as  this  car  depreciation example, you must
  177.        provide a data file containing the  values  of  the  dependent  and
  178.        independent  variables  for a set of observations.  In this example
  179.        each observation record would contain three  numbers:  value,  age,
  180.        and  miles,  collected  from  used  car ads for the same model car.
  181.        The more observations you provide, the more accurate  will  be  the
  182.        estimate  of  the  parameters.  The Nonlin commands to perform this
  183.        regression are shown below:
  184.  
  185.             VARIABLES VALUE,AGE,MILES
  186.             PARAMETERS PRICE,DEPAGE,DEPMILES
  187.             FUNCTION VALUE = PRICE + DEPAGE*AGE + DEPMILES*MILES
  188.             DATA
  189.             (data values go here)
  190.  
  191.        Once the values of the parameters are  determined  by  Nonlin,  you
  192.        can  use the formula to predict the value of a car based on its age
  193.  
  194.  
  195.                                         1
  196.  
  197.        Chapter 1. Introduction                                           2
  198.  
  199.  
  200.        and miles driven.  For example,  if  Nonlin  computed  a  value  of
  201.        16000  for  price,  -1000  for depage, and -0.15 for depmiles, then
  202.        the function
  203.  
  204.             value = 16000 - 1000*age - 0.15*miles
  205.  
  206.        could be used to estimate the value of a car with a known  age  and
  207.        number of miles.
  208.  
  209.        If  a perfect fit existed between the function and the actual data,
  210.        the actual value of each car in your data file would exactly  equal
  211.        the  predicted  value.   Typically,  however, this is not the case,
  212.        and the difference  between  the  actual  value  of  the  dependent
  213.        variable  and  its  predicted value for a particular observation is
  214.        the error of the estimate which is  known  as  the  "deviation"  or
  215.        "residual".   The  goal  of regression analysis is to determine the
  216.        values of the parameters which minimize  the  sum  of  the  squared
  217.        residual  values  for  the set of observations.  This is known as a
  218.        "least squares" regression fit.
  219.  
  220.        1.2 Introduction to Nonlin
  221.  
  222.        Nonlin is a very powerful regression analysis  program.   Using  it
  223.        you  can  perform  multivariate,  linear,  polynomial, exponential,
  224.        logistic, and general nonlinear regression.   What  this  means  is
  225.        that  you  specify  the  form  of  the function to be fitted to the
  226.        data,  and  the  function  may  include  nonlinear  terms  such  as
  227.        variables  raised  to  powers  and  library  functions such as log,
  228.        exponential, sine, etc.  Nonlin uses a state-of-the-art  regression
  229.        algorithm  that  works  as well, or better, than any you are likely
  230.        to find in commercial statistical packages.
  231.  
  232.        As  an  example   of   nonlinear   regression,   consider   another
  233.        depreciation  problem.   The value of a used airplane decreases for
  234.        each year of its age.  Assuming the value of a plane falls  by  the
  235.        same amount each year, a linear function relating value to age is:
  236.  
  237.             Value = p0 + p1*Age
  238.  
  239.        Where  'p0'  and  'p1'  are  the  parameters whose values are to be
  240.        determined.  However, it is a well  known  fact  that  planes  (and
  241.        automobiles)  lose  more  value the first year than the second, and
  242.        more the second than the third, etc.   This  means  that  a  linear
  243.        (straight  line)  function  cannot accurately model this situation.
  244.        A better, nonlinear, function is:
  245.  
  246.             Value = p0 + p1*exp(-p2*Age)
  247.  
  248.        Where the 'exp' function is the value of  e  (2.7182818...)  raised
  249.        to   a  power.   This  type  of  function  is  known  as  "negative
  250.        exponential" and is appropriate for modeling a value whose rate  of
  251.        decrease  is  proportional  to the difference between the value and
  252.        some base value.  The  F33YEAR.NLR  example  command  file  fits  a
  253.        linear  function  to  the  value of used airplanes.  The F33EXP.NLR
  254.        example fits a negative exponential  function  to  the  same  data.
  255.  
  256.        Chapter 1. Introduction                                           3
  257.  
  258.  
  259.        Run  both  examples  and compare the fitted functions.  See F33.NLR
  260.        for an example of a multiple  regression  using  three  independent
  261.        variables.
  262.  
  263.        Much  of the convenience of Nonlin comes from the fact that you can
  264.        enter complicated  functions  using  ordinary  algebraic  notation.
  265.        Examples of functions that can be handled with Nonlin include:
  266.  
  267.             Linear:        Y = p0 + p1*X
  268.  
  269.             Quadratic:     Y = p0 + p1*X + p2*X^2
  270.  
  271.             Multivariate:  Y = p0 + p1*X + p2*Z + p3*X*Z
  272.  
  273.             Exponential:   Y = p0 + p1*exp(X)
  274.  
  275.             Periodic:      Y = p0 + p1*sin(p2*X)
  276.  
  277.             Misc:          Y = p0 + p1*Y + p2*exp(Y) + p3*sin(Z)
  278.  
  279.        In  other words, the function is a general expression involving one
  280.        dependent variable (on the left of the equal  sign),  one  or  more
  281.        independent  variables, and one or more parameters whose values are
  282.        to be estimated.
  283.  
  284.        Because  of  its  generality,  Nonlin  can  perform  all   of   the
  285.        regressions  handled  by ordinary linear or multivariate regression
  286.        programs as well as nonlinear regression.   However,  in  order  to
  287.        handle  nonlinear  functions,  Nonlin  uses  an  iterative function
  288.        optimization algorithm which  is  slower  than  the  simple  linear
  289.        regression  algorithm and has the potential for not converging to a
  290.        solution.
  291.  
  292.        1.3 Installing Nonlin
  293.  
  294.        The Nonlin system consists of the following files:
  295.  
  296.               NONLIN.EXE -- The executable program.
  297.               NONLIN.DOC -- Documentation file.
  298.               NONLIN.FON -- Font file used if you request a plot.
  299.               NONLIN.LJF -- LaserJet font file (registered version only).
  300.                    *.NLR -- Example command files.
  301.             REGISTER.DOC -- Form used to register your use of Nonlin.
  302.  
  303.        To install Nonlin, copy  the  files  into  the  directory  of  your
  304.        choice.   The  registered  version  of Nonlin includes a file named
  305.        NONLIN.LJF with the fonts needed for printing plots on HP  LaserJet
  306.        printers.   If  you do not plan to generated hard copy output for a
  307.        LaserJet printer, you may  delete  the  NONLIN.LJF  file.   If  the
  308.        NONLIN.FON  and NONLIN.LJF files are not in your current directory,
  309.        you  must  place  a  command  of  the  following   form   in   your
  310.        AUTOEXEC.BAT file to tell Nonlin where to look for its font files:
  311.  
  312.             SET NONLIN=directory
  313.  
  314.        Chapter 1. Introduction                                           4
  315.  
  316.  
  317.        Where  "directory"  is  the  name of the device and directory where
  318.        the files are located.  For example, if the files are located in  a
  319.        directory  named  NONLIN on the C disk, the following command could
  320.        be used:
  321.  
  322.             SET NONLIN=C:\NONLIN
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.                                     Chapter 2
  330.  
  331.                                   Using Nonlin
  332.  
  333.  
  334.  
  335.  
  336.        Once Nonlin has been installed, it  can  be  started  using  a  DOS
  337.        command of the form:
  338.  
  339.             NONLIN command_file [listing_file]
  340.  
  341.        where  "command_file"  is  the  name  of  a  file containing Nonlin
  342.        commands that control  the  analysis.   The  sections  that  follow
  343.        describe  these  commands.   If  you  specify  a  command file name
  344.        without an extension, ".NLR" is used as the default extension.   If
  345.        you  omit  the  command  file  name,  Nonlin  prints  a list of its
  346.        commands.
  347.  
  348.        A "listing_file" parameter may be specified on  the  command  line.
  349.        If  you specify a file name, the output (results) of the regression
  350.        analysis are written to this file.  If no file name  is  specified,
  351.        the  output  is  written  to  a  file  with  the  same  name as the
  352.        command_file but with the  extension  ".LST".   If  you  specify  a
  353.        listing  file  name without an extension, ".LST" is provided as the
  354.        default extension.  Specify NUL for the listing_file if you do  not
  355.        want to generate an output file.
  356.  
  357.        For  example, to process a command file named LINEAR.NLR, directing
  358.        output to a file named LINEAR.LST, use the following command:
  359.  
  360.             NONLIN LINEAR
  361.  
  362.        To do the same analysis, directing  the  output  to  a  file  named
  363.        MODEL1.LST, use the following command:
  364.  
  365.             NONLIN LINEAR MODEL1
  366.  
  367.        Normally  Nonlin commands and computed results are displayed on the
  368.        screen and written to the listing file; however,  if  you  place  a
  369.        NOECHO   command  in  your  command  file  the  screen  display  is
  370.        suppressed but the output is still written to the listing file.
  371.  
  372.        At this point, I suggest you pause in your reading and try  running
  373.        a  Nonlin  example to get a feel for how it works.  Several example
  374.        files  with  the   extension   ".NLR"   are   provided   with   the
  375.        distribution.   LINEAR.NLR  is a good one to start with followed by
  376.        AIDS.NLR.  If  you  do  not  have  a  graphics  monitor,  edit  the
  377.        LINEAR.NLR  command  file  (and other example files) and remove the
  378.        PLOT command.
  379.  
  380.  
  381.                                         5
  382.  
  383.        Chapter 2. Using Nonlin                                           6
  384.  
  385.  
  386.        2.1 Function Specification
  387.  
  388.        Much of the power of Nonlin comes from its ability to estimate  the
  389.        value  of  parameters  that  are part of complicated functions that
  390.        you enter in ordinary algebraic form.  This  section  explains  the
  391.        arithmetic  operators  and  built-in  functions  that  are  used to
  392.        specify a function.
  393.  
  394.        2.1.1 Arithmetic Operators
  395.  
  396.        The following arithmetic operators may be used in expressions:
  397.  
  398.             +        addition
  399.             -        subtraction or unary minus
  400.             *        multiplication
  401.             /        division
  402.             ** or ^  exponentiation
  403.  
  404.        Exponentiation   has   the   highest   precedence,   followed    by
  405.        multiplication  and  division,  and  then addition and subtraction.
  406.        Parentheses may be used to group terms.
  407.  
  408.        2.1.2 Numeric Constants
  409.  
  410.        Numeric constants may be written in their natural form (1, 0,  1.5,
  411.        .0003,  etc.) or in exponential form, n.nnnEppp, where n.nnn is the
  412.        base value and ppp is the  power  of  ten  by  which  the  base  is
  413.        multiplied.   For example, the number 1.5E4 is equivalent to 15000.
  414.        All numbers are treated as "floating point" values,  regardless  of
  415.        whether  a decimal point is specified or not.  As a convenience for
  416.        entering time values, if a value contains one or more  colons,  the
  417.        portion  to  the  left  of  the  colon  is  multiplied  by 60.  For
  418.        example, 1:00 is equivalent to 60; 1:00:00 is equivalent to 3600.
  419.  
  420.        2.1.3 Symbolic Constants
  421.  
  422.        You can use the CONSTANT command to associate symbolic  names  with
  423.        constant  numeric  values.   When  you use the symbolic name in the
  424.        function the numeric value is substituted for the symbolic name.
  425.  
  426.        2.1.4 Built-in Constants
  427.  
  428.        There are two built-in numeric  constants  that  may  be  specified
  429.        using  symbolic names.  The symbolic name "PI" is equivalent to the
  430.        value of pi, 3.14159...  Similarly, the symbolic  constant  "E"  is
  431.        equivalent  to the base of natural logarithms, e, 2.7182818...  You
  432.        may write PI and E using either upper or lower case.
  433.  
  434.        Chapter 2. Using Nonlin                                           7
  435.  
  436.  
  437.        2.1.5 Built-in Functions
  438.  
  439.        The following functions are built into Nonlin and may  be  used  in
  440.        expressions:
  441.  
  442.        ABS(x) -- Absolute value of x.
  443.  
  444.        ACOS(x) -- Arc cosine of x.  Angles are measured in radians.
  445.  
  446.        ASIN(x) -- Arc sine of x.  Angles are measured in radians.
  447.  
  448.        ATAN(x) -- Arc tangent of x.  Angles are measured in radians.
  449.  
  450.        BETAI(x,a,b)  -- Incomplete beta function: Ix(a,b).  The incomplete
  451.            beta function can be used to compute a variety  of  statistical
  452.            functions.   For  example,  the probability of Student's t with
  453.            'df'   degrees   of    freedom    can    be    computed    with
  454.            BETAI(df/(df+t^2),.5*df,.5).    The   probability   of   the  F
  455.            statistic with df1 and df2 degrees of freedom can  be  computed
  456.            with 2*BETAI(df2/(df2+df1*f),.5*df2,.5*df1).
  457.  
  458.        COS(x) -- Cosine of x.  Angles are measured in radians.
  459.  
  460.        COSH(x) -- Hyperbolic cosine of x.
  461.  
  462.        COT(x) -- Cotangent of x.  (COT(x) = 1/TAN(x)).  Angle in radians.
  463.  
  464.        CSC(X) -- Cosecant of x.  (CSC(x) = 1/SIN(x)).  Angle in radians.
  465.  
  466.        DEG(x)  --  Converts  an  angle,  x,  measured  in  radians  to the
  467.            equivalent number of degrees.
  468.  
  469.        EI1(alpha,phi) -- Elliptic integral of the  first  kind.   Computes
  470.            the   integral   from   0   to  phi  radians  of  the  function
  471.            d.phi/sqrt(1-k**2*sin(phi)**2), where k  =  sin(alpha).   alpha
  472.            and phi must be in the range 0 to pi/2.
  473.  
  474.        EI2(alpha,phi)  --  Elliptic integral of the second kind.  Computes
  475.            the  integral  from  0  to  phi   radians   of   the   function
  476.            sqrt(1-k**2*sin(phi)**2)*d.phi,  where  k  = sin(alpha).  alpha
  477.            and phi must be in the range 0 to pi/2.
  478.  
  479.        EIC1(alpha) --  Complete  elliptic  integral  of  the  first  kind.
  480.            Computes  the  integral  from 0 to pi/2 radians of the function
  481.            d.phi/sqrt(1-k**2*sin(phi)**2), where k  =  sin(alpha).   alpha
  482.            must be in the range 0 to (less than) pi/2.
  483.  
  484.        EIC2(alpha)  --  Complete  elliptic  integral  of  the second kind.
  485.            Computes the integral from 0 to pi/2 radians  of  the  function
  486.            sqrt(1-k**2*sin(phi)**2)*d.phi,  where  k  = sin(alpha).  alpha
  487.            must be in the range 0 to pi/2.
  488.  
  489.        ERF(x) -- Standard error function of x.
  490.  
  491.        Chapter 2. Using Nonlin                                           8
  492.  
  493.  
  494.        EXP(x) -- e (base of natural logarithms) raised to the x power.
  495.  
  496.        FAC(x) -- x factorial (x!).  Note, the  FAC  function  is  computed
  497.            using  the  GAMMA  function  (FAC(x)=GAMMA(x+1)) so non-integer
  498.            argument values may be computed.
  499.  
  500.        GAMMA(x) -- Gamma function.  Note, GAMMA(x+1) = x!  (x factorial).
  501.  
  502.        GAMMAI(x)  --   Reciprocal   of   GAMMA   function   (GAMMAI(x)   =
  503.            1/GAMMA(x)).
  504.  
  505.        GAMMALN(x) -- Log (base e) of the GAMMA function.
  506.  
  507.        HAV(x)  --  Haversine  of  x.   (HAV(x)  = (1-COS(x))/2).  Angle in
  508.            radians.
  509.  
  510.        J0(x) -- Bessel function of the first kind, order zero.
  511.  
  512.        J1(x) -- Bessel function of the first kind, order one.
  513.  
  514.        JN(n,x) -- Bessel function of the first kind, order n.
  515.  
  516.        LOG(x) -- Natural logarithm of x.
  517.  
  518.        LOG10(x) -- Base 10 logarithm of x.
  519.  
  520.        LOG2(x) -- Base 2 logarithm of x.
  521.  
  522.        MAX(x1,x2) -- Maximum value of x1 or x2.
  523.  
  524.        MIN(x1,x2) -- Minimum value of x1 or x2.
  525.  
  526.        NORMAL(x) -- Normal probability distribution of x.  X is  in  units
  527.            of  standard  deviations  from  the  mean.   See  also  the NPD
  528.            function.  NORMAL(x) = NPD(x,0,1);
  529.  
  530.        NPD(x,mean,std)  --  Normal  probability  distribution  of  x  with
  531.            specified  mean  and  standard  deviation.   X  is  in units of
  532.            standard deviations from the mean.
  533.  
  534.        PAREA(x) -- Area under the normal  probability  distribution  curve
  535.            from  -infinity  to  x.  (i.e., integral from -infinity to x of
  536.            NORMAL(x)).
  537.  
  538.        PULSE(a,x,b) -- Pulse function.  If the value of x is less  than  a
  539.            or  greater  than  b,  the value of the function is 0.  If x is
  540.            greater than or equal to a and less than or  equal  to  b,  the
  541.            value  of  the  function is 1.  In other words, it is 1 for the
  542.            domain (a,b) and zero elsewhere.  If you need a  function  that
  543.            is   zero  in  the  domain  (a,b)  and  1  elsewhere,  use  the
  544.            expression (1-PULSE(a,x,b)).
  545.  
  546.        RAD(x) -- Converts an angle measured in degrees to  the  equivalent
  547.            number of radians.
  548.  
  549.        Chapter 2. Using Nonlin                                           9
  550.  
  551.  
  552.        SEC(x) -- Secant of x.  (SEC(x) = 1/COS(x)).  Angle in radians.
  553.  
  554.        SEL(a1,a2,v1,v2)  --  If  a1  is less than a2 then the value of the
  555.            function is v1.  If a1 is greater than or  equal  to  a2,  then
  556.            the value of the function is v2.
  557.  
  558.        SIN(x) -- Sine of x.  Angles are measured in radians.
  559.  
  560.        SINH(x) -- Hyperbolic sine of x.
  561.  
  562.        SQRT(x) -- Square root of x.
  563.  
  564.        STEP(a,x)  -- Step function.  If x is less than a, the value of the
  565.            function is 0.  If x is greater than or equal to a,  the  value
  566.            of  the function is 1.  If you need a function which is 1 up to
  567.            a  certain  value  and  then  0  beyond  that  value,  use  the
  568.            expression  STEP(x,a).   See  PIECE.NLR  for an example of this
  569.            function.
  570.  
  571.        T(n,x) -- Chebyshev polynomial of order n.
  572.  
  573.        TAN(x) -- Tangent of x.  Angles are measured in radians.
  574.  
  575.        TANH(x) -- Hyperbolic tangent of x.
  576.  
  577.        Y0(x) -- Bessel function of the second kind, order zero.
  578.  
  579.        Y1(x) -- Bessel function of the second kind, order one.
  580.  
  581.        YN(n,x) -- Bessel function of the second kind, order n.
  582.  
  583.        2.2 Nonlin Command Files
  584.  
  585.        The commands described in this section  are  placed  in  a  command
  586.        file.   When  you start Nonlin, you specify the name of the command
  587.        file as a parameter on the  command  line.   For  example,  if  the
  588.        command  file  name  is  CAR.NLR, the following command would cause
  589.        Nonlin to execute the commands in the command file:
  590.  
  591.             NONLIN CAR.NLR
  592.  
  593.        If you do not specify a file name extension for the  command  file,
  594.        ".NLR"  is  used by default.  The output of the regression for this
  595.        example would be written to a file named  CAR.LST.   Command  files
  596.        can  be created using a text editor such as EDIT-32, EDLIN, the DOS
  597.        EDIT program, or  any  other  editor  or  word  processor  that  is
  598.        capable of creating an ascii text file without formatting codes.
  599.  
  600.        Comments  may  be  placed in command files by preceding the comment
  601.        with an exclamation point.  Entire lines may be used  for  comments
  602.        and comments can be placed at the end of commands.
  603.  
  604.        Command  lines can be continued by placing a semicolon character as
  605.        the last non-blank character on the line (a comment may follow  the
  606.  
  607.        Chapter 2. Using Nonlin                                          10
  608.  
  609.  
  610.        semicolon)  and  then  continuing  the  command  on  the  following
  611.        line(s).
  612.  
  613.        Every command file must contain the following commands:  VARIABLES,
  614.        PARAMETERS,  FUNCTION, and DATA.  The DATA statement introduces the
  615.        data for the analysis and must be the  last  command  in  the  file
  616.        (data  records  may  follow  it).  Other, optional, commands may be
  617.        interspersed in the command file.  The following is an  example  of
  618.        a complete command file:
  619.  
  620.             VARIABLES  VALUE,AGE,MILES
  621.             PARAMETERS BASE,DEPAGE,DEPMILES
  622.             FUNCTION VALUE = BASE + DEPAGE*AGE + DEPMILES*MILES
  623.             DATA
  624.             (data records follow)
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.                                     Chapter 3
  632.  
  633.                                  Nonlin Commands
  634.  
  635.  
  636.  
  637.  
  638.        The  following  is  a list of the valid Nonlin commands that can be
  639.        placed  in  a  Nonlin  command  file.   Command  keywords  may   be
  640.        abbreviated  to  the  first  three  letters  except  for  CONSTANT,
  641.        CONSTRAIN,  and  CONFIDENCE  which  require  six  letters.   Nonlin
  642.        commands are not case sensitive.
  643.  
  644.        3.1 TITLE
  645.  
  646.        TITLE  string  (optional) -- Specifies a title line that is printed
  647.        with the results of the analysis.
  648.  
  649.        3.2 VARIABLES
  650.  
  651.        VARIABLES var1,var2,...  (required) -- Specifies the names  of  the
  652.        variables  that  will  be  used  in  the  function.   The dependent
  653.        variable and the independent  variables  must  be  specified.   The
  654.        order  of  the  variable  names  must  match  the order of the data
  655.        values on each observation record (the dependent variable may  come
  656.        before  or  after  the independent variables).  You may define more
  657.        variables than you actually use in the function  specification.   A
  658.        maximum  of  12  variables  may  be  specified.   The  length  of a
  659.        variable  name  is  limited  to  10  characters.   Capitalize   the
  660.        variable names as you want them displayed in the results.
  661.  
  662.        You  may  specify  all  of  the  variables on a single command line
  663.        (which may  be  continued),  or  you  may  use  multiple  VARIABLES
  664.        commands.   If  you  use multiple commands, the order in which they
  665.        appear in the command file must match the  order  of  the  variable
  666.        values  on  each  observation  record.   The VARIABLES command must
  667.        precede the FUNCTION command.  See F33.NLR  for  an  example  of  a
  668.        multiple regression using three independent variables.
  669.  
  670.        3.3 PARAMETERS
  671.  
  672.        PARAMETERS  param1[=initial1],param2[=initial2],...   (required) --
  673.        Specifies the names of  the  parameters  whose  values  are  to  be
  674.        determined  by  Nonlin.   Nonlin  is  capable  of handling up to 12
  675.        parameters.  The parameter names may not exceed  10  characters  in
  676.        length.   Do  not  specify  any parameters that are not used in the
  677.        function.   The  PARAMETERS  command  must  precede  the   FUNCTION
  678.        command.
  679.  
  680.  
  681.  
  682.  
  683.                                        11
  684.  
  685.        Chapter 3. Nonlin Commands                                       12
  686.  
  687.  
  688.        Optionally,  an  initial  estimate  of  the  parameter value may be
  689.        specified by following the parameter name with an  equal  sign  and
  690.        the  value.   If  no  value  is  specified,  1  is used by default.
  691.        Specifying an initial value that is near the actual  value  usually
  692.        speeds   up   the   operation  of  Nonlin  and  may  enable  it  to
  693.        successfully converge to  a  solution.   If  Nonlin  is  unable  to
  694.        converge  to  a  solution, try specifying different starting values
  695.        for the parameters.  Try to specify a value that at least  has  the
  696.        correct sign as the expected final value.
  697.  
  698.        The  CONSTRAIN command (see page 13) can be used to limit the range
  699.        of values for parameters.  The SWEEP command (see page 13)  can  be
  700.        used  to  perform the regression analysis with a range of parameter
  701.        initial values.  The CONSTANT command  can  be  used  to  define  a
  702.        parameter with a fixed value.
  703.  
  704.        3.4 CONFIDENCE
  705.  
  706.        CONFIDENCE  [percent]  (optional)  --  Specifies  that a confidence
  707.        interval is to  be  printed  for  each  estimated  parameter.   The
  708.        purpose  of  regression  analysis is to determine the best estimate
  709.        of  parameter  values.    However,   as   with   most   statistical
  710.        calculations,  the  values  determined  are  estimates  of the true
  711.        values.  The CONFIDENCE command causes  Nonlin  to  print  a  table
  712.        showing  the  range  of  possible values for each parameter given a
  713.        specified confidence value.  The "percent" parameter specifies  the
  714.        probability  that  that the actual value of the parameter is within
  715.        the confidence interval to be computed.  For example, the command
  716.  
  717.             CONFIDENCE 95
  718.  
  719.        specifies that the confidence interval(s) are to be  computed  such
  720.        that  there  is  a 95 percent probability that the actual values of
  721.        the parameters are within the intervals  (or  that  there  is  a  5
  722.        percent  chance  that  the  parameters  are outside the intervals).
  723.        The "percent" parameter may  range  from  50  to  99.999.   If  the
  724.        CONFIDENCE  command  is used without specifying a percent value, 90
  725.        is used by default.
  726.  
  727.        3.5 CONSTANT
  728.  
  729.        CONSTANT parameter=value (optional) --  Specifies  the  name  of  a
  730.        symbolic  constant  and  associates  a numeric value.  You may then
  731.        use the  symbolic  name  in  the  function  and  the  corresponding
  732.        constant  numeric  value  will be substituted.  This is useful when
  733.        you are trying out different models and want to easily be  able  to
  734.        change  a  constant value for each run.  The CONSTANT commands must
  735.        precede the FUNCTION command.  The following is  an  example  of  a
  736.        symbolic  constant  named "Roomtemp" that causes the value 73 to be
  737.        substituted in the function:
  738.  
  739.        Chapter 3. Nonlin Commands                                       13
  740.  
  741.  
  742.             Variable Time            ! Cooling time in seconds
  743.             Variable Temp            ! Temperature of object
  744.             Constant Roomtemp = 73        ! Ambient temperature
  745.             Parameter InitTemp        ! Initial temperature
  746.             Parameter Coolrate        ! Cooling rate factor
  747.             Function Temp = Roomtemp + InitTemp * exp(-Coolrate * Time)
  748.  
  749.        3.6 CONSTRAIN
  750.  
  751.        CONSTRAIN parameter=lowvalue,highvalue (optional)  --  Specifies  a
  752.        lower  and  upper  limit on the range of a parameter value.  During
  753.        the solution process, Nonlin  may  allow  a  parameter's  value  to
  754.        temporarily  move  in  a direction away from its final value.  With
  755.        some functions it may be necessary  to  constrain  the  parameter's
  756.        value  so that it does not go negative (e.g., if the function takes
  757.        the square root of the parameter), or zero (if the parameter is  in
  758.        a  denominator).  If a parameter is tightly constrained, Nonlin may
  759.        report "singular convergence" because it is unable to  converge  to
  760.        an  optimum  value  of the parameter; however, the estimated values
  761.        of other parameters may be useful.
  762.  
  763.        Only a single parameter and its associated limits may be  specified
  764.        on  each  CONSTRAIN  command,  but  you  may use multiple CONSTRAIN
  765.        commands.   The  PARAMETERS  command  must  precede  the  CONSTRAIN
  766.        command.   Use  the  CONSTANT  command  if  you  wish  to  define a
  767.        parameter with a fixed value.
  768.  
  769.        The  parameter  value  is  allowed  to  range  from  'lowvalue'  to
  770.        'highvalue'.   If  you want to prevent a parameter value from going
  771.        to zero, you must specify a value greater than  zero  for  the  low
  772.        value  (specifying  zero would allow it to reach, but not go below,
  773.        zero).  For example, the following command constrains the value  of
  774.        'age' to be greater than zero and less than or equal to 100:
  775.  
  776.             CONSTRAIN AGE = .0001,100
  777.  
  778.        See  the  COOLING.NLR, F33EXP.NLR, and POWER.NLR files for examples
  779.        of the CONSTRAIN command.
  780.  
  781.        3.7 COVARIANCE
  782.  
  783.        COVARIANCE (optional) -- Causes the variance-covariance matrix  for
  784.        the parameters to be printed.
  785.  
  786.        3.8 SWEEP
  787.  
  788.        SWEEP parameter=lowvalue,highvalue,stepsize (optional) --
  789.        Specifies   that   the  regression  analysis  is  to  be  performed
  790.        repeatedly with a set of starting values for  the  parameter.   The
  791.        first   analysis   is  performed  with  the  parameter  having  the
  792.        'lowvalue';  the  value  of  'stepsize'  is  then  added   to   the
  793.        parameter's  initial  value  and  the  analysis is performed again.
  794.        The process is repeated until the value of  the  parameter  reaches
  795.        'highvalue'.
  796.  
  797.        Chapter 3. Nonlin Commands                                       14
  798.  
  799.  
  800.        Each  time  the analysis is performed the value of the residual sum
  801.        of  squares  is  compared  with  the  best  previous  result.   The
  802.        estimated  values of the parameters for the best starting value are
  803.        saved and used for the final analysis and report.
  804.  
  805.        Only one parameter may be specified on each SWEEP command, but  you
  806.        may  have  as  many  SWEEP  commands  as there are parameters.  The
  807.        number of regression  analyses  performed  will  be  equal  to  the
  808.        product of the number of parameter values for each SWEEP command.
  809.  
  810.        The  SWEEP  command  is  useful  when  you  are  trying  to  fit  a
  811.        complicated function that may have  "local  minimum"  values  other
  812.        than  the  "global  minimum".   Periodic functions (sin, cos, etc.)
  813.        are especially troublesome.
  814.  
  815.        See the SINE.NLR command file for an example of the SWEEP command.
  816.  
  817.        3.9 FUNCTION
  818.  
  819.        FUNCTION depvar = function (required) -- Specifies the form of  the
  820.        function  whose  parameters  are  to  be determined.  The dependent
  821.        variable must be the only thing to the  left  of  the  equal  sign.
  822.        The  expression  to  the  right  of  the  equal  sign  may  contain
  823.        variables, parameters, constants, operators, and library  functions
  824.        such  as  sqrt,  sin,  exp,  etc.   The  VARIABLES  and  PARAMETERS
  825.        commands  must  have  appeared  in  the  command  file  before  the
  826.        FUNCTION  command,  and  all  variables  and parameters used in the
  827.        function must have been specified on those commands.  Some  example
  828.        FUNCTION commands are show below:
  829.  
  830.             FUNCTION  Y = P0 + P1*X
  831.  
  832.             FUNCTION  DISTANCE = .5 * ACCEL * TIME^2
  833.  
  834.             FUNCTION  VALUE = PRICE + YRDEP*AGE + MILEDEP*MILES
  835.  
  836.             FUNCTION  POPULATN = BASE * GROWRATE * EXP(TIME)
  837.  
  838.        3.10 TOLERANCE
  839.  
  840.        TOLERANCE   value   (optional,   default=1E-10)  --  Specifies  the
  841.        tolerance factor that is used to determine when the  algorithm  has
  842.        converged  to a solution.  Reducing the tolerance value may produce
  843.        a slightly more accurate result but will  increase  the  number  of
  844.        iterations  and  the  running time.  The tolerance value must be in
  845.        the range 1E-15 to 1E-1.
  846.  
  847.        3.11 ITERATIONS
  848.  
  849.        ITERATIONS value (optional, default=50) --  Specifies  the  maximum
  850.        number  of  iterations  that  should be attempted by the algorithm.
  851.        If the solution does not converge to the  limit  specified  by  the
  852.        TOLERANCE  command (or to the default tolerance) before the maximum
  853.        number of iterations is reached, the process  is  stopped  and  the
  854.  
  855.        Chapter 3. Nonlin Commands                                       15
  856.  
  857.  
  858.        results  are  printed.   Failure  to  converge before the specified
  859.        number of iterations could be caused by one of three things:
  860.  
  861.        1.  The maximum allowed number of  iterations  may  be  too  small.
  862.            Try using an ITERATIONS command with a larger value.
  863.  
  864.        2.  The  tolerance  factor  may  be  too  small.   Even  a properly
  865.            converging solution will eventually "level  off"  or  oscillate
  866.            around  a  good, but non-zero, sum of squares value.  Try using
  867.            the TOLERANCE command to increase the tolerance value.
  868.  
  869.        3.  The function may not be converging.  Try specifying better  (or
  870.            at  least  different) starting values for the parameters on the
  871.            PARAMETERS  command.   Consider  using  the  SWEEP  command  to
  872.            specify a range of parameter starting values.
  873.  
  874.        3.12 REGISTER
  875.  
  876.        REGISTER   (optional)   --  The  REGISTER  command  suppresses  the
  877.        copyright and registration message that  is  otherwise  written  to
  878.        the  listing  file  generated  by  the shareware version of Nonlin.
  879.        The REGISTER  command  performs  no  function  for  the  registered
  880.        version  of Nonlin.  The use of this command is a reminder that you
  881.        should register your use of Nonlin.  Note, if you  find  Nonlin  to
  882.        be  useful,  educational,  or  entertaining  you  are  expected  to
  883.        register your use so that the author can be justly compensated  and
  884.        that  development  of  the  program  can continue.  Use the form in
  885.        REGISTER.DOC (or on page 42) to register your use.
  886.  
  887.        3.13 OUTPUT
  888.  
  889.        OUTPUT [TO file] var1,var2,...  (optional) -- Specifies that  after
  890.        the  analysis  is  completed,  data  values  are  to  be printed or
  891.        written to a file.  If the "TO file"  portion  of  the  command  is
  892.        specified,  the  output  is written to the specified file.  If this
  893.        portion of the command is omitted, the output  values  are  printed
  894.        along  with  the  results.   If a file name is specified without an
  895.        extension, ".OUT" is used by default.
  896.  
  897.        The list of variable names determines which variables  are  written
  898.        to  the  file  and  the  order  in  which the values appear in each
  899.        output record.  Any variable previously  declared  on  a  VARIABLES
  900.        command  may  be  specified.   In  addition,  the following special
  901.        variable names may appear in the output list:
  902.  
  903.        $OBS  --  The  observation  record  number,  starting  at   1   and
  904.        increasing by 1.
  905.  
  906.        $PREDICTED  --  The  predicted value for the dependent variable for
  907.        the observation, given the  independent  variable  values  and  the
  908.        parameters as calculated by the analysis.
  909.  
  910.        $RESIDUAL  --  The  difference  between  the  actual  value  of the
  911.        dependent variable and its predicted value.
  912.  
  913.        Chapter 3. Nonlin Commands                                       16
  914.  
  915.  
  916.        Examples of OUTPUT commands are shown below:
  917.  
  918.             OUTPUT AGE,MILES,VALUE,$PREDICTED,$RESIDUAL
  919.             OUTPUT TO GROWTH.DAT $OBS,TIME,POPULATN,$PREDICTED
  920.  
  921.        3.14 POUTPUT
  922.  
  923.        POUTPUT file (optional)  --  The  POUTPUT  command  specifies  that
  924.        Nonlin  is to write the final estimated values of the parameters to
  925.        a file.  Each parameter value is written to a separate line of  the
  926.        file.   This  command  is  useful  to  create  a  file of estimated
  927.        parameter values to be fed into  another  analysis  program.   This
  928.        command  can  also  be used to determine the parameter estimates to
  929.        more significant digits  than  displayed  in  the  printed  listing
  930.        because  the  format  used by the POUTPUT command writes the values
  931.        with 18 significant digits.
  932.  
  933.        3.15 PLOT
  934.  
  935.        PLOT [options] (optional) --  Display  a  plot  of  the  calculated
  936.        function  and  the  data  observations.   The PLOT command can only
  937.        handle  a  single  independent   variable   (multiple   independent
  938.        variables  would  require  an n-dimensional surface plot); however,
  939.        there  is  no  restriction  on  the  number  of  parameters   being
  940.        estimated.
  941.  
  942.        You  must  have a CGA, EGA, or VGA monitor to use the PLOT command,
  943.        and the NONLIN.FON font file must be in the  current  directory  or
  944.        in  a  directory  specified by the NONLIN environment variable.  In
  945.        the plot, the data values you provided are shown as  blue  X's  and
  946.        the  function  fitted  to  the  data  by Nonlin is shown as a solid
  947.        green line.  Press Return to proceed with the  analysis  after  you
  948.        have finished looking at the plot.
  949.  
  950.        The following options may be specified on the PLOT command:
  951.  
  952.        GRID -- display grid lines to make it easier to estimate values.
  953.  
  954.        RESIDUAL  --  draw  vertical lines from each observed data point to
  955.            the  corresponding  point  on  the  calculated  function  line.
  956.            These  lines  represent  the  "residual"  value  that Nonlin is
  957.            attempting to minimize.   See  also  the  descriptions  of  the
  958.            RPLOT and NPLOT commands on pages 17 and 18.
  959.  
  960.        ITERATION  --  draw  a  plot  for  each iteration of the regression
  961.            analysis.  Normally, the plot is drawn after the  analysis  has
  962.            converged  to  a  solution; you may use the ITERATION option to
  963.            observe the function during each iteration of the  analysis  as
  964.            it converges to fit the data.
  965.  
  966.        VALUES  --  use  in  conjunction with the ITERATION option to cause
  967.            the current parameter values to be displayed  before  the  plot
  968.            for the current iteration.
  969.  
  970.        Chapter 3. Nonlin Commands                                       17
  971.  
  972.  
  973.        PRINT  -- print a copy of the plot on an HP LaserJet printer.  This
  974.            option is only available in the registered version  of  Nonlin.
  975.            Nonlin  writes  the  plot  to  the  PRN  device  which  much be
  976.            attached to an  HP  Series  II  or  Series  III  printer.   The
  977.            NONLIN.LJF  font  file must be in the current directory or in a
  978.            directory specified by the NONLIN environment variable.
  979.  
  980.        NOPAUSE -- do not pause after the  plot  is  displayed.   Normally,
  981.            Nonlin  pauses  after  displaying  a  plot to allow you time to
  982.            examine it; you press Enter  to  continue  execution  once  you
  983.            have  finished  looking at the plot.  The NOPAUSE option causes
  984.            Nonlin to continue with execution  without  pausing  after  the
  985.            plot  is  displayed.   This  is  useful in conjunction with the
  986.            PRINT option when Nonlin is run in a batch file  and  you  want
  987.            to  generate  a  hardcopy  plot  but not pause after the screen
  988.            display.
  989.  
  990.        The option keywords may be abbrievated to their first  letter.   If
  991.        more  than one option is specified, separate them with commas.  For
  992.        example, to produce a  plot  with  both  grid  lines  and  residual
  993.        lines, use the following command:
  994.  
  995.             PLOT GRID,RESIDUAL
  996.  
  997.        3.16 RPLOT
  998.  
  999.        RPLOT  [options]  (optional)  --  Display  a  plot  of the residual
  1000.        values.  A "residual" value (or error deviation) is the  difference
  1001.        between   an   actual  value  of  the  dependent  variable  for  an
  1002.        observation and the predicted value based on  the  function  fitted
  1003.        by  the  regression  analysis.   If the calculated function exactly
  1004.        predicted the  actual  observation  values,  all  of  the  residual
  1005.        values  would  be  zero.  However, this is usually not the case and
  1006.        the residual values  show  where,  and  by  how  much,  the  fitted
  1007.        function fails to predict the actual observations.
  1008.  
  1009.        The  RPLOT  command  causes  Nonlin  to  display a plot showing the
  1010.        residual values on  the  vertical  (Y)  axis  and  the  independent
  1011.        variable  values  on the horizontal (X) axis.  However, if there is
  1012.        more than one independent variable, Nonlin  displays  the  residual
  1013.        values  on  the vertical (Y) axis and the dependent variable values
  1014.        on the horizontal (X)  axis.   The  plot  title  indicates  if  the
  1015.        dependent variable was used for the X axis.
  1016.  
  1017.        A  residual  plot is very useful for determining if the form of the
  1018.        function being fitted is appropriate for the data values.   If  the
  1019.        residual  values  are randomly distributed in positive and negative
  1020.        directions  then  the  form  (shape)  of  the  fitted  function  is
  1021.        probably  appropriate  for  the  data and the deviations are due to
  1022.        random measurement errors.   If,  however,  the  residuals  show  a
  1023.        systematic  pattern such as a periodic cycle, then the function may
  1024.        not be appropriate for the data values.  See the discussion of  the
  1025.        Durbin-Watson  statistic  in  Section  4.9, page 23, for additional
  1026.        information  about  autocorrelated  residual  values.   The   PLOT,
  1027.        RPLOT,  and  NPLOT  commands  may be used in the same command file.
  1028.  
  1029.        Chapter 3. Nonlin Commands                                       18
  1030.  
  1031.  
  1032.        Press Return to proceed with the analysis after you  have  finished
  1033.        looking at the plot.
  1034.  
  1035.        The following options may be specified on the RPLOT command:
  1036.  
  1037.        GRID -- display grid lines to make it easier to estimate values.
  1038.  
  1039.        PRINT  -- print a copy of the plot on an HP LaserJet printer.  This
  1040.            option is only available in the registered version  of  Nonlin.
  1041.            Nonlin  writes  the  plot  to  the  PRN  device  which  much be
  1042.            attached to an HP Series II or Series III printer.
  1043.  
  1044.        NOPAUSE -- do not pause after the  plot  is  displayed.   Normally,
  1045.            Nonlin  pauses  after  displaying  a  plot to allow you time to
  1046.            examine it; you press Enter  to  continue  execution  once  you
  1047.            have  finished  looking at the plot.  The NOPAUSE option causes
  1048.            Nonlin to continue with execution  without  pausing  after  the
  1049.            plot is displayed.
  1050.  
  1051.        The  option  keywords may be abbrievated to their first letter.  If
  1052.        more than one option is specified, separate them with commas.
  1053.  
  1054.        3.17 NPLOT
  1055.  
  1056.        NPLOT [options] (optional) -- Display a normal probability plot  of
  1057.        the  residual  values.   In  this  plot,  the  actual value of each
  1058.        residual is plotted on the  vertical  (Y)  axis  and  the  expected
  1059.        value   of  the  residual,  assuming  the  residuals  are  normally
  1060.        distributed, is  plotted  on  the  horizontal  (X)  axis.   If  the
  1061.        residuals  are  normally  distributed, the resulting plot will be a
  1062.        straight line passing through the origin with a slope of  1  (i.e.,
  1063.        the  actual  value of each residual should equal the expected value
  1064.        from the normal distribution).  If the residuals are  not  normally
  1065.        distributed, the plot will deviate from a straight line.
  1066.  
  1067.        This   plot  also  computes  the  correlation  between  the  actual
  1068.        residual  values  and  their  expected  values  and  displays   the
  1069.        correlation  coefficient  in  the  title  line  "(r=n.nn)".  If the
  1070.        residual values are normally distributed,  the  correlation  should
  1071.        be  close  to  1.00.   A  correlation value less than 0.94 suggests
  1072.        that the residuals are not normally distributed.
  1073.  
  1074.        The NPLOT command may be used  even  if  there  is  more  than  one
  1075.        independent  variable.   The PLOT, RPLOT, and NPLOT commands may be
  1076.        used in the same command file.  Press Return to  proceed  with  the
  1077.        analysis after you have finished looking at the plot.
  1078.  
  1079.        The following options may be specified on the NPLOT command:
  1080.  
  1081.        GRID -- display grid lines to make it easier to estimate values.
  1082.  
  1083.        PRINT  -- print a copy of the plot on an HP LaserJet printer.  This
  1084.            option is only available in the registered version  of  Nonlin.
  1085.            Nonlin  writes  the  plot  to  the  PRN  device  which  much be
  1086.            attached to an HP Series II or Series III printer.
  1087.  
  1088.        Chapter 3. Nonlin Commands                                       19
  1089.  
  1090.  
  1091.        NOPAUSE -- do not pause after the plot is displayed.
  1092.  
  1093.        The option keywords may be abbrievated to their first  letter.   If
  1094.        more than one option is specified, separate them with commas.
  1095.  
  1096.        DOMAIN  lowvalue,highvalue  (optional) -- Specifies the domain over
  1097.        which the plot is to be generated.   If  the  DOMAIN  statement  is
  1098.        omitted,  the  domain  of  the independent variable is used for the
  1099.        plot.  The DOMAIN statement can be used to generate a plot  of  the
  1100.        fitted  function  extrapolated  over the specified domain.  You can
  1101.        also use the DOMAIN command to restrict the domain  and  "zero  in"
  1102.        on  a  particular  range  of the function.  The DOMAIN command only
  1103.        affects the  PLOT  command;  it  does  not  affect  the  regression
  1104.        calculation or the RPLOT or NPLOT commands.
  1105.  
  1106.        3.18 PRESOLUTION
  1107.  
  1108.        PRESOLUTION  value (optional) -- Specifies whether plots sent to HP
  1109.        LaserJet printers should use 150 or  300  dot-per-inch  resolution.
  1110.        This  option is only available in the registered version of Nonlin.
  1111.        The value parameter must be 150 or 300.  The default value  is  150
  1112.        causes  the  plots to use most of the horizontal width of an 8.5x11
  1113.        inch page.   These  plots  are  suitable  for  direct  transfer  to
  1114.        overhead   transparencies.    Specifying  300  for  the  resolution
  1115.        produces smaller plots that are suitable for inclusion  in  printed
  1116.        documents.
  1117.  
  1118.        3.19 WIDTH
  1119.  
  1120.        WIDTH  value (optional) -- Specify the width, in inches, of printed
  1121.        plots.  This option is only available in the registered version  of
  1122.        Nonlin.   Due  to memory space considerations, the maximum width is
  1123.        limited to about 7.9 inches for 150 DPI resolution and  4.5  inches
  1124.        for  300 DPI resolution.  If you have limited memory space, you may
  1125.        have to reduce the width to  be  able  to  produce  printed  plots.
  1126.        This  statement  is  ignored  unless  you  request  that  a plot be
  1127.        printed.
  1128.  
  1129.        3.20 NOECHO
  1130.  
  1131.        NOECHO (optional) --  Specifies  that  the  commands  and  computed
  1132.        results  are  not  to be listed on the screen.  The output is still
  1133.        written to the listing file and any requested plots  are  displayed
  1134.        on the screen.
  1135.  
  1136.        3.21 DATA
  1137.  
  1138.        DATA   [file]   (required)  --  Specifies  the  name  of  the  file
  1139.        containing the data records, or introduces the data  records  which
  1140.        follow  the  command.   If  a  file  name  is specified on the DATA
  1141.        command, the file is opened, its data records  are  read,  and  the
  1142.        regression  analysis  is  performed.   If  a file name is specified
  1143.        without an extension, ".DAT" is used by default.
  1144.  
  1145.        Chapter 3. Nonlin Commands                                       20
  1146.  
  1147.  
  1148.        If no file name is specified on the DATA command, the data  records
  1149.        must immediately follow the DATA command in the command file.
  1150.  
  1151.        Each  data  record must contain at least as many data values as the
  1152.        number of variables specified on  the  VARIABLES  command(s).   The
  1153.        order  of  the variables as specified on the VARIABLES command must
  1154.        match the order of  the  values  in  each  observation.   Any  data
  1155.        values  beyond  those  required  for  the  specified  variables are
  1156.        ignored.  Each observation must begin on a new line.
  1157.  
  1158.        The data values must be separated by one or more  spaces  and/or  a
  1159.        comma.    Data  values  may  contain  decimal  points  and  may  be
  1160.        expressed  in  exponential  notation  (i.e.,  n.nnnnEppp).   As   a
  1161.        convenience  for  entering  time values, if a value contains one or
  1162.        more colons, the portion to the left of the colon is multiplied  by
  1163.        60.   For  example, 1:00 is equivalent to 60; 1:00:00 is equivalent
  1164.        to 3600.
  1165.  
  1166.        You may continue data lines by specifying a semicolon as  the  last
  1167.        non-blank  character  on a record and then placing the continuation
  1168.        value on the following line(s).
  1169.  
  1170.        The DATA command must be the last command in the command file.   If
  1171.        no  file  name  is  specified on the DATA command, the data records
  1172.        must immediately follow the DATA command in the command file.   The
  1173.        following  is  an example of a complete command file including data
  1174.        records:
  1175.  
  1176.             VARIABLES AGE,MILES,VALUE
  1177.             PARAMETERS BASE,DEPAGE,DEPMILES
  1178.             FUNCTION VALUE = BASE + DEPAGE*AGE + DEPMILES*MILES
  1179.             DATA
  1180.             2  10000  13000
  1181.             4  42000   9000
  1182.             1   7000  17000
  1183.             6  52000   6000
  1184.             5  48000   8000
  1185.  
  1186.        If the data records had  been  placed  in  a  separate  file  named
  1187.        CAR.DAT, the DATA statement would be changed to "DATA CAR.DAT".
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.                                     Chapter 4
  1195.  
  1196.                             Understanding The Results
  1197.  
  1198.  
  1199.  
  1200.  
  1201.        4.1 Descriptive Statistics for Variables
  1202.  
  1203.        Nonlin  prints a variety of statistics at the end of each analysis.
  1204.        For each variable, Nonlin lists  the  minimum  value,  the  maximum
  1205.        value,  the  mean  value,  and  the standard deviation.  You should
  1206.        confirm that these values are within the ranges you expect.
  1207.  
  1208.        4.2 Parameter Estimates
  1209.  
  1210.        For each parameter, Nonlin displays the initial parameter  estimate
  1211.        (which  you  specified  on the PARAMETER command, or 1 by default),
  1212.        the final (maximum likelihood) estimate, the standard error of  the
  1213.        estimated   parameter   value,  the  "t"  statistic  comparing  the
  1214.        estimated parameter value with zero, and the significance of the  t
  1215.        statistic.    Nine   significant   digits  are  displayed  for  the
  1216.        parameter estimates.  If you need to determine  the  parameters  to
  1217.        greater precision, use the POUTPUT command.
  1218.  
  1219.        The  final  estimate  parameter  values  are  the  results  of  the
  1220.        analysis.   By  substituting  these  values  in  the  equation  you
  1221.        specified  to  be fitted to the data, you will have a function that
  1222.        can be used to predict the value of the  dependent  variable  based
  1223.        on  a set of values for the independent variables.  For example, if
  1224.        the equation being fitted is
  1225.  
  1226.             y = p0 + p1*x
  1227.  
  1228.        and the final estimates are 1.5 for p0  and  3  for  p1,  then  the
  1229.        equation
  1230.  
  1231.             y = 1.5 + 3*x
  1232.  
  1233.        is  the best equation of this form that will predict the value of y
  1234.        based on the value of x.
  1235.  
  1236.        4.3 t Statistic
  1237.  
  1238.        The "t" statistic is computed by dividing the  estimated  value  of
  1239.        the  parameter  by its standard error.  This statistic is a measure
  1240.        of the likelihood that the actual value of  the  parameter  is  not
  1241.        zero.   The  larger  the  absolute value of t, the less likely that
  1242.        the actual value of the parameter could be zero.
  1243.  
  1244.  
  1245.  
  1246.                                        21
  1247.  
  1248.        Chapter 4. Understanding The Results                             22
  1249.  
  1250.  
  1251.        4.4 Prob(t)
  1252.  
  1253.        The "Prob(t)" value is the probability of obtaining  the  estimated
  1254.        value  of the parameter if the actual parameter value is zero.  The
  1255.        smaller the value of Prob(t), the more  significant  the  parameter
  1256.        and  the  less likely that the actual parameter value is zero.  For
  1257.        example, assume the estimated value of a parameter is 1.0  and  its
  1258.        standard  error  is 0.7.  Then the t value would be 1.43 (1.0/0.7).
  1259.        If the computed Prob(t) value was 0.05  then  this  indicates  that
  1260.        there  is  only  a  0.05  (5%)  chance that the actual value of the
  1261.        parameter could be zero.   If  Prob(t)  was  0.001  this  indicates
  1262.        there  is  only  1 chance in 1000 that the parameter could be zero.
  1263.        If Prob(t) was 0.92 this indicates that there is a 92%  probability
  1264.        that  the actual value of the parameter could be zero; this implies
  1265.        that the term of the regression equation containing  the  parameter
  1266.        can  be  eliminated without significantly affecting the accuracy of
  1267.        the regression.
  1268.  
  1269.        The t statistic probability is computed  using  a  two-sided  test.
  1270.        The  CONFIDENCE  command  can  be  used  to  cause  Nonlin to print
  1271.        confidence intervals for parameter values.  The SQUARE.NLR  example
  1272.        regression  includes  an  extraneous parameter (p0) whose estimated
  1273.        value is much smaller than its standard error;  the  Prob(t)  value
  1274.        is  0.99982  indicating  that  there is a high probability that the
  1275.        value is zero.
  1276.  
  1277.        4.5 Final Sum of Squared Deviations
  1278.  
  1279.        In addition to the variable and parameter values,  Nonlin  displays
  1280.        several  statistics  that  indicate  how well the equation fits the
  1281.        data.  The "Final sum of squared deviations"  is  the  sum  of  the
  1282.        squared  differences  between  the  actual  value  of the dependent
  1283.        variable for each  observation  and  the  value  predicted  by  the
  1284.        function, using the final parameter estimates.
  1285.  
  1286.        4.6 Average and Maximum Deviation
  1287.  
  1288.        The  "Average  deviation"  is  the average over all observations of
  1289.        the absolute value of the difference between the  actual  value  of
  1290.        the dependent variable and its predicted value.
  1291.  
  1292.        The   "Maximum  deviation  for  any  observation"  is  the  maximum
  1293.        difference (ignoring sign) between the actual and  predicted  value
  1294.        of the dependent variable for any observation.
  1295.  
  1296.        4.7 Proportion of Variance Explained
  1297.  
  1298.        The  "Proportion  of  variance  explained (R^2)" indicates how much
  1299.        better the function  predicts  the  dependent  variable  than  just
  1300.        using  the  mean  value  of  the  dependent variable.  This is also
  1301.        known  as  the  "coefficient  of  multiple  determination."  It  is
  1302.        computed  as  follows:  Suppose  that we did not fit an equation to
  1303.        the  data  and  ignored  all  information  about  the   independent
  1304.        variables  in  each observation.  Then, the best prediction for the
  1305.        dependent variable value for any  observation  would  be  the  mean
  1306.  
  1307.        Chapter 4. Understanding The Results                             23
  1308.  
  1309.  
  1310.        value  of  the  dependent  variable  over  all  observations.   The
  1311.        "variance" is the sum of the squared differences between  the  mean
  1312.        value   and   the   value   of  the  dependent  variable  for  each
  1313.        observation.  Now, if we use our fitted  function  to  predict  the
  1314.        value  of the dependent variable, rather than using the mean value,
  1315.        a second kind of variance can be computed by taking the sum of  the
  1316.        squared  difference  between  the  value  of the dependent variable
  1317.        predicted by the function and the  actual  value.   Hopefully,  the
  1318.        variance  computed by using the values predicted by the function is
  1319.        better (i.e., a smaller value) than  the  variance  computed  using
  1320.        the   mean  value.   The  "Proportion  of  variance  explained"  is
  1321.        computed as 1 - (variance using predicted value  /  variance  using
  1322.        mean).   If  the function perfectly predicts the observed data, the
  1323.        value of this statistic will be 1.00 (100%).  If the function  does
  1324.        no  better  a  job  of predicting the dependent variable than using
  1325.        the mean, the value will be 0.00.
  1326.  
  1327.        4.8 Adjusted Coefficient of Multiple Determination
  1328.  
  1329.        The "adjusted coefficient of multiple determination (Ra^2)"  is  an
  1330.        R^2  statistic  adjusted  for  the  number  of  parameters  in  the
  1331.        equation and the  number  of  data  observations.   It  is  a  more
  1332.        conservative   estimate  of  the  percent  of  variance  explained,
  1333.        especially when the sample size is small compared to the number  of
  1334.        parameters.  It is computed using the formula:
  1335.  
  1336.             Ra^2 = 1 - (n-1)/(n-p) * (1-R^2)
  1337.  
  1338.        where  'n'  is  the  number  of  observations, 'p' is the number of
  1339.        parameters, and 'R^2' is the  unadjusted  coefficient  of  multiple
  1340.        determination.
  1341.  
  1342.        4.9 Durbin-Watson Statistic
  1343.  
  1344.        The  "Durbin-Watson  test  for autocorrelation" is a statistic that
  1345.        indicates the likelihood that the deviation (error) values for  the
  1346.        regression   have  a  first-order  autoregression  component.   The
  1347.        regression  models   assume   that   the   error   deviations   are
  1348.        uncorrelated.
  1349.  
  1350.        In  business  and  economics,  many regression applications involve
  1351.        time series data.  If a non-periodic function, such as  a  straight
  1352.        line,  is  fitted  to  periodic data the deviations have a periodic
  1353.        form and are positively correlated over time; these deviations  are
  1354.        said    to    be   "autocorrelated"   or   "serially   correlated."
  1355.        Autocorrelated deviations may also indicate that the  form  (shape)
  1356.        of  the  function being fitted is inappropriate for the data values
  1357.        (e.g., a linear equation fitted to quadratic data).
  1358.  
  1359.        If the deviations are autocorrelated, there  may  be  a  number  of
  1360.        consequences  for the computed results: 1) The estimated regression
  1361.        coefficients no longer have the minimum variance property;  2)  the
  1362.        mean  square  error  (MSE) may seriously underestimate the variance
  1363.        of  the  error  terms;  3)  the  computed  standard  error  of  the
  1364.        estimated  parameter  values  may  underestimate  the true standard
  1365.  
  1366.        Chapter 4. Understanding The Results                             24
  1367.  
  1368.  
  1369.        error, in which case the t values and confidence intervals  may  be
  1370.        incorrect.   Note  that  if  an  appropriate  periodic  function is
  1371.        fitted to periodic data, the deviations from  the  regression  will
  1372.        be  uncorrelated  because the cycle of the data values is accounted
  1373.        for by the fitted function.
  1374.  
  1375.        Small values of the Durbin-Watson statistic indicate  the  presence
  1376.        of   autocorrelation.    Consult  significance  tables  in  a  good
  1377.        statistics book for exact interpretations; however,  a  value  less
  1378.        than  0.80  usually  indicates  that autocorrelation is likely.  If
  1379.        the Durbin-Watson statistic indicates that the residual values  are
  1380.        autocorrelated,  it  is  recommended  that you use the RPLOT and/or
  1381.        NPLOT commands to display a plot of the residual values.
  1382.  
  1383.        If an NPLOT command is used to produce a  normal  probability  plot
  1384.        of  the  residuals, the correlation between the residuals and their
  1385.        expected  values  (assuming  they  are  normally  distributed)   is
  1386.        printed   in   the   listing.    If   the  residuals  are  normally
  1387.        distributed,  the  correlation  should  be  close   to   1.00.    A
  1388.        correlation  less  than  0.94  suggests  that the residuals are not
  1389.        normally distributed.
  1390.  
  1391.        4.10 Analysis of Variance Table
  1392.  
  1393.        An "Analysis of  Variance"  table  provides  statistics  about  the
  1394.        overall significance of the model being fitted.
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.                                     Chapter 5
  1402.  
  1403.                                Theory of Operation
  1404.  
  1405.  
  1406.  
  1407.  
  1408.        5.1 Minimization Algorithm
  1409.  
  1410.        Nonlin  uses  a model/trust-region technique along with an adaptive
  1411.        choice of the  model  Hessian.   The  algorithm  is  essentially  a
  1412.        combination   of   Gauss-Newton  and  Levenberg-Marquardt  methods;
  1413.        however, the  adaptive  algorithm  often  works  much  better  than
  1414.        either of these methods alone.
  1415.  
  1416.        The  basis  for  the  minimization  technique  used by Nonlin is to
  1417.        compute the sum of the squared residuals for one set  of  parameter
  1418.        values  and  then slightly alter each parameter value and recompute
  1419.        the sum of squared residuals to see how the parameter value  change
  1420.        affects  the  sum  of  the  squared  residuals.   By  dividing  the
  1421.        difference between the original and new  sum  of  squared  residual
  1422.        values  by  the amount the parameter was altered, Nonlin is able to
  1423.        determine the approximate partial derivative with  respect  to  the
  1424.        parameter.   This  partial  derivative  is used by Nonlin to decide
  1425.        how to alter the value of the parameter for the next iteration.
  1426.  
  1427.        If the function being modeled is well  behaved,  and  the  starting
  1428.        value  for the parameter is not too far from the optimum value, the
  1429.        procedure will eventually converge to the  best  estimate  for  the
  1430.        parameter.   This  procedure  is carried out simultaneously for all
  1431.        parameters  and  is,   in   fact,   a   minimization   problem   in
  1432.        n-dimensional space, where 'n' is the number of parameters.
  1433.  
  1434.        For  a  much  more detailed explanation of the regression algorithm
  1435.        used by Nonlin see ACM Transactions on  Mathematical  Software  7,3
  1436.        (Sept.   1981)  "Dennis,  J.E.,  Gay, D.M., and Welsch, R.E.  -- An
  1437.        adaptive nonlinear least-squares algorithm."
  1438.  
  1439.        5.2 Convergence Criterion
  1440.  
  1441.        Nonlin has several convergence criterion that  stop  the  iterative
  1442.        minimization  procedure.   The  TOLERANCE  command  can  be used to
  1443.        alter the convergence tolerance value.
  1444.  
  1445.        Two internal variables are used to determine when  convergence  has
  1446.        occurred.   RFCTOL  has a default value of 1E-10 and can be altered
  1447.        by use of the TOLERANCE command.  AFCTOL has  a  default  value  of
  1448.        1E-20  and  is  only  altered by the TOLERANCE command if the value
  1449.        specified is less than the default value.  In the discussion  which
  1450.  
  1451.  
  1452.  
  1453.                                        25
  1454.  
  1455.        Chapter 5. Theory of Operation                                   26
  1456.  
  1457.  
  1458.        follows  the  "function  value"  is  half  the  sum  of the squared
  1459.        residuals computed using the current parameter estimates.
  1460.  
  1461.        "Relative  function  convergence"  is  reported  if  the  predicted
  1462.        maximum  possible  function  reduction  is  at  most RFCTOL*ABS(F0)
  1463.        where F0 is  the  function  value  at  the  start  of  the  current
  1464.        iteration,  and  if  the  last step attempted achieved no more than
  1465.        twice the predicted function decrease.
  1466.  
  1467.        "Absolute function convergence" is reported if the  function  value
  1468.        is less than AFCTOL.
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.                                     Chapter 6
  1476.  
  1477.                               Hints for Nonlin Use
  1478.  
  1479.  
  1480.  
  1481.  
  1482.        6.1 Convergence Failures
  1483.  
  1484.        One   of  the  potential  problems  that  confronts  any  nonlinear
  1485.        minimization  procedure  is  non-convergence.   Non-convergence  is
  1486.        usually  not  a  problem  for regressions using a linear model, but
  1487.        becomes  a  more  serious  consideration  when  using   complicated
  1488.        nonlinear   functions;   increasing   the   number   of  parameters
  1489.        aggravates the problem.
  1490.  
  1491.        Non-convergence can occur in two ways: the solution may diverge  or
  1492.        it  may  converge  to  the wrong solution -- a local minimum rather
  1493.        than the global minimum.  Periodic  functions,  such  as  sin,  and
  1494.        cos,  are particularly prone to convergence problems.  For example,
  1495.        consider a nonlinear regression performed with the function:
  1496.  
  1497.             y = offset + amplitude * sin(frequency * x)
  1498.  
  1499.        where x and y are variables, and offset, amplitude,  and  frequency
  1500.        are  the  parameters  whose  values  are  to be determined.  If the
  1501.        starting value  for  frequency  is  not  reasonably  close  to  the
  1502.        correct  value,  the solution may converge to a harmonic (multiple)
  1503.        or subharmonic (fundamental) value of  the  frequency.   A  command
  1504.        file  named  SINE.NLR  is  supplied  with  the commands and data to
  1505.        perform this analysis.
  1506.  
  1507.        The SWEEP command can  be  very  useful  in  cases  like  the  sine
  1508.        example.   In  the  SINE.NLR  example analysis, the actual value of
  1509.        the frequency is 3; the function converges to the correct  solution
  1510.        if  the  starting  value is in the range 2.6 to 3.3.  However, this
  1511.        example  is  quite  insensitive  to  the  starting  value  of   the
  1512.        amplitude  parameter.   With  an  actual  value  of  2, the correct
  1513.        solution is found  with  starting  values  from  1  through  10000.
  1514.        Similarly,  the  offset parameter, which had an actual value of 10,
  1515.        was successfully determined with starting values ranging from 1  to
  1516.        over 50000.
  1517.  
  1518.        Another  example  which  is sensitive to a parameter starting value
  1519.        is  POWER.NLR  which  attempts  to  determine  the  values  of  the
  1520.        parameters p0, p1, and p2 for the function
  1521.  
  1522.             y = p0 + p1*x^p2
  1523.  
  1524.  
  1525.  
  1526.  
  1527.                                        27
  1528.  
  1529.        Chapter 6. Hints for Nonlin Use                                  28
  1530.  
  1531.  
  1532.        (where  "x^p2"  means  x raised to the p2 power).  The actual value
  1533.        of p2 in the example data is 2; the  solution  converges  correctly
  1534.        if  the  starting  value of p2 is in the range 1.8 to 3.8.  As with
  1535.        the other example, the solution is relatively  insensitive  to  the
  1536.        starting values of p0 and p1.
  1537.  
  1538.        6.2 Singular Matrix Problems
  1539.  
  1540.        Another  possible  problem  is  that the analysis may stop with the
  1541.        message "Singular convergence.   Mutually  dependent  parameters?".
  1542.        This  is  usually  due  to  one  of  two  things:  (1)  a redundant
  1543.        parameter that is co-dependent with another  parameter,  or  (2)  a
  1544.        situation  where  the value of one parameter "blocks" the effect of
  1545.        other  parameters.   As  an  example  of  a  redundant   parameter,
  1546.        consider the function
  1547.  
  1548.             y = p0 + p1*p2*x
  1549.  
  1550.        This  is  a simple linear equation except there are two parameters,
  1551.        p1, and p2, which are both factors to the variable  x.   It  should
  1552.        be  clear  that  there  is no unique solution to this problem since
  1553.        any value of p1 is possible if the right value  of  p2  is  chosen.
  1554.        Similarly, the function
  1555.  
  1556.             y = p0 + p1 + p2*x
  1557.  
  1558.        has  no  unique  solution  since  either  p0  or  p1  is redundant.
  1559.        Similarly, in the equation
  1560.  
  1561.             y = p0 + p1*exp(x+p2)
  1562.  
  1563.        either p1 or p2 is redundant.
  1564.  
  1565.        The second type of singular matrix problem can  be  illustrated  by
  1566.        the function
  1567.  
  1568.             y = p0 + p1*x^p2
  1569.  
  1570.        If,  during  the  solution  process,  p1 takes on the value 0, then
  1571.        varying the value of p2 has no effect on the  equation  and  Nonlin
  1572.        cannot  figure  out  which  way  to  change the value of p2 to move
  1573.        toward convergence.  The solution to this problem is  to  assign  a
  1574.        starting  value  that  is  not  zero  to  p1, and use the CONSTRAIN
  1575.        command to force p1 to remain non-zero.
  1576.  
  1577.        6.3 Performance Issues
  1578.  
  1579.        Nonlin is carefully programmed  and  compiled  with  an  optimizing
  1580.        compiler  for  maximum  performance.   However,  Nonlin  is  a real
  1581.        "number  cruncher,"  and  the  nonlinear  regression  algorithm  is
  1582.        mathematically  very  elaborate.   During  each  iteration,  Nonlin
  1583.        computes  gradients,  Jacobians,  Hessians,  and  eigenvalues,  and
  1584.        performs  QR  and Cholesky matrix decompositions.  All calculations
  1585.        are carried out using double precision (64 bit) floating point.
  1586.  
  1587.        Chapter 6. Hints for Nonlin Use                                  29
  1588.  
  1589.  
  1590.        Nonlin does not require  an  80x87  numeric  coprocessor,  but  its
  1591.        performance  is  greatly  enhanced  if one is present.  In fact, an
  1592.        8088 CPU with an 8087 numeric coprocessor  can  perform  regression
  1593.        analyses  faster  than  a  20  MHz  80386  that  does  not  have  a
  1594.        coprocessor.  If  you  have  an  8088  without  a  coprocessor,  be
  1595.        patient -- Nonlin is probably giving it the workout of its life.
  1596.  
  1597.        Very  long  running  times  can result if you use the SWEEP command
  1598.        with many starting values.  The problem is compounded if  you  have
  1599.        multiple  SWEEP  commands.   If  you use the SWEEP command to try a
  1600.        large number of starting parameter values, you  can  save  time  by
  1601.        using   the  ITERATIONS  command  to  specify  a  small  number  of
  1602.        iterations (such as  5)  during  the  initial  attempt  to  find  a
  1603.        solution.   Once  a  feasible  set of starting parameter values has
  1604.        been determined, remove the SWEEP  command,  specify  the  starting
  1605.        values   on   the   PARAMETERS  command,  increase  the  number  of
  1606.        iterations, and rerun the analysis to get the final result.
  1607.  
  1608.        6.4 Program Limits
  1609.  
  1610.        The following is a summary of the Nonlin program limitations:
  1611.  
  1612.             Maximum number of variables = 12
  1613.             Maximum number of parameters = 12
  1614.             Maximum length of variable or parameter names = 10
  1615.  
  1616.        The maximum number of data  observations  that  Nonlin  can  handle
  1617.        depends  on  the  number  of  parameters as shown by the table that
  1618.        follows:
  1619.  
  1620.             # Parameters    Max Observations
  1621.                   1               2019
  1622.                   2               1611
  1623.                   3               1339
  1624.                   4               1144
  1625.                   5                997
  1626.                   6                883
  1627.                   7                791
  1628.                   8                715
  1629.                   9                652
  1630.                  10                599
  1631.  
  1632.        A commercial version of Nonlin that can handle more  variables  and
  1633.        parameters is available.  Contact the author for information.
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.                                     Chapter 7
  1641.  
  1642.                                 Example Analyses
  1643.  
  1644.  
  1645.  
  1646.  
  1647.        A  number  of  example  regression analysis files are provided with
  1648.        your Nonlin distribution.  All of the example  command  files  have
  1649.        the  extension  ".NLR".   Some  of the important ones are described
  1650.        below, others contain comment lines that explain what they do.
  1651.  
  1652.        LINEAR.NLR -- Simple linear regression with  plotted  function  and
  1653.            data.
  1654.  
  1655.        QUAD.NLR  --  Fit  a quadratic equation.  Plot the function and the
  1656.            data.
  1657.  
  1658.        ASYMPTOT.NLR -- Fit an asymptotic function Y = 12 - 10/X.
  1659.  
  1660.        AIDS.NLR -- A logistic curve  is  a  growth  curve  used  to  model
  1661.            functions  which  increase  gradually at first, more rapidly in
  1662.            the middle growth period, and slowly at the end,  leveling  off
  1663.            at  a  maximum  value  after some period of time.  This type of
  1664.            curve is frequently used to model  biological  growth  patterns
  1665.            where  there  is  an initial exponential growth period followed
  1666.            by a leveling off as more of the population is infected  or  as
  1667.            the  food  supply  or  some other factor limits further growth.
  1668.            The form of the symmetric logistic growth function is:
  1669.  
  1670.                 y = k / (1 + exp(a + b*x))
  1671.  
  1672.            where 'k', 'a', and 'b' are parameters  that  shape  and  scale
  1673.            the function.  The value of 'b' is negative.
  1674.  
  1675.            The  AIDS.NLR  example  fits  a logistic curve to the number of
  1676.            new cases of AIDS reported in  the  United  States  during  the
  1677.            period  1981 through 1992.  The computed function fits the data
  1678.            remarkably  well  showing  that  the  AIDS  infection  rate  is
  1679.            following  a  classic  logistic  curve  and should level off at
  1680.            about 47,500 new cases per year (in the  United  States).   The
  1681.            DOMAIN  command is used to cause Nonlin to extrapolate the plot
  1682.            of the function through 1995.
  1683.  
  1684.        F33.NLR -- Multivariate linear  regression  (multiple  regression).
  1685.            Calculate  the value of a used Beech F33 Bonanza airplane using
  1686.            a linear model based on its age, the number  of  hours  on  its
  1687.            airframe,  and  the number of hours on its engine.  The t value
  1688.            and Prob(t) indicate that the number of  hours  on  the  engine
  1689.            ('Engdep'  parameter)  is  not  significant  to  the regression
  1690.  
  1691.  
  1692.                                        30
  1693.  
  1694.        Chapter 7. Example Analyses                                      31
  1695.  
  1696.  
  1697.            model; the other parameters are significant but airframe  hours
  1698.            is less significant than the base price and age of the plane.
  1699.  
  1700.        F33YEAR.NLR  --  Similar to F33.NLR except the price of the Bonanza
  1701.            is calculated based on a linear function of only the age.
  1702.  
  1703.        F33EXP.NLR -- Similar to F33YEAR.NLR except a negative  exponential
  1704.            function  is  used  rather than a linear function.  Compare the
  1705.            fit of this model with that of the F33YEAR.NLR example.
  1706.  
  1707.        SINE.NLR -- Fit an equation involving a sin  function.   The  SWEEP
  1708.            command is used to find a starting point that will converge.
  1709.  
  1710.        SQUARE.NLR  --  Fit  a  sine series to a square wave.  Note in this
  1711.            example that the 'p0' parameter, which represents the  constant
  1712.            term  of  the  equation, has an estimated value of 9.22715E-006
  1713.            (very nearly zero) and a standard  error  of  0.0398754.   This
  1714.            yields  a  t  value of nearly zero and Prob(t) of 0.99982 which
  1715.            means that there is a 99.982% chance that the actual  value  of
  1716.            p0  may be zero (it is in fact zero).  This illustrates how you
  1717.            can  use  the  t  value  and  Prob(t)  to  identify  extraneous
  1718.            parameters.
  1719.  
  1720.        COOLING.NLR  --  Fit an equation involving an exponential function.
  1721.            If a heated object is allowed to cool, the rate of  cooling  at
  1722.            any  instant  is  proportional  to  the  difference between the
  1723.            object's temperature and the ambient  (room)  temperature.   In
  1724.            other  words, an object cools faster at first, while it is hot,
  1725.            and the rate of cooling slows down as the  temperature  of  the
  1726.            object  approaches  the ambient temperature.  The function that
  1727.            relates the object's temperature to time is:
  1728.  
  1729.                 Temperature = Roomtemp+InitTemp*exp(-Coolrate*Time)
  1730.  
  1731.            Where InitTemp is the number of degrees above room  temperature
  1732.            at  time  0,  and Coolrate is a factor that depends on the mass
  1733.            of the  object,  how  well  it  is  insulated,  etc.   The  exp
  1734.            function  is  the  value of e (2.7182818...) raised to a power.
  1735.            The COOLING.NLR example determines the parameters InitTemp  and
  1736.            Coolrate  to  fit  an  equation  of  this form to some data the
  1737.            author collected.
  1738.  
  1739.        BOIL.NLR -- The boiling point of water decreases  as  the  pressure
  1740.            in  the  vessel  containing  the water decreases.  "Clapeyron's
  1741.            equation" shows that the boiling point is related  to  pressure
  1742.            according to the following function:
  1743.  
  1744.                 Temperature = b / log(Pressure/a) - 459.7
  1745.  
  1746.            Where   'Temperature'  is  in  degrees  Fahrenheit  (the  459.7
  1747.            constant converts degrees  Fahrenheit  to  degrees  Rankine  --
  1748.            relative  to  absolute zero), 'Pressure' is the pressure in the
  1749.            vessel  in  pounds  per  square  inch,  and  'a'  and  'b'  are
  1750.            parameters  whose  values  are  to be determined.  The data for
  1751.  
  1752.        Chapter 7. Example Analyses                                      32
  1753.  
  1754.  
  1755.            this example was collected by the author's son  for  a  science
  1756.            project.
  1757.  
  1758.        MAGNET.NLR  --  Fit  a  function  involving  an  arc  tangent and a
  1759.            variable to the third power.  This is  an  interesting  physics
  1760.            problem.   If  a  magnet  is  placed due east of a compass, the
  1761.            deflection of the compass needle from north  is  equal  to  the
  1762.            arc  tangent of the ratio of the strength of the magnet's field
  1763.            relative to the earth's magnetic field.  The  strength  of  the
  1764.            magnet's  field at the compass is inversely proportional to the
  1765.            cube of the distance from the magnet  to  the  compass.   Thus,
  1766.            the function relating these terms is
  1767.  
  1768.                 Deflection = deg(atan(Strength / Distance ^ 3))
  1769.  
  1770.            The  deg  function converts an angle in radians to degrees.  In
  1771.            the example, Deflection and Distance  are  the  variables,  and
  1772.            the value of the Strength parameter is determined.
  1773.  
  1774.        DIODE.NLR  --  The current through a diode increases sharply as the
  1775.            voltage across  the  diode  is  increased.   An  equation  that
  1776.            approximates the current flow as a function of the voltage is:
  1777.  
  1778.                 I = exp(b*(V-c))
  1779.  
  1780.            where  'I' is the current, 'V' is the voltage, and 'b', and 'c'
  1781.            are parameters that  are  to  be  estimated  by  the  nonlinear
  1782.            regression.
  1783.  
  1784.        AVLTIME.NLR  -- An AVL tree is a balanced binary tree used to store
  1785.            information in a computer's memory.  Because the entries in  an
  1786.            AVL  tree  are  kept in sorted order, and the tree is kept in a
  1787.            balanced form, it is possible to rapidly find any entry in  the
  1788.            tree.   The  time required to create an AVL tree with N entries
  1789.            is approximately equal to:
  1790.  
  1791.                 Time = a + b*N*log2(N)
  1792.  
  1793.            where 'a' is a constant term equal to the overhead involved  in
  1794.            starting  and  completing  a tree creation, and 'b' is a growth
  1795.            coefficient that depends on the speed  of  the  computer.   The
  1796.            log2(N)  function  is  the  log  base  2  of  N  (the number of
  1797.            entries).  The AVLTIME.NLR example fits an equation to  a  data
  1798.            set  that relates the time in seconds required to create an AVL
  1799.            tree with the number of entries in the tree.
  1800.  
  1801.        PIECE.NLR -- Piecewise linear function.  Fit a function  consisting
  1802.            of  two linear pieces that bend at X=5.  When X is less than 5,
  1803.            the slope of the function is B1.  When X  is  greater  than  or
  1804.            equal  to  5,  the  slope  is  B2.   B0  is  the Y value of the
  1805.            function at X=5 (i.e., at  the  pivot  point).   The  step(a,x)
  1806.            function  returns  the  value  0  when  x  is less than 'a'; it
  1807.            returns 1 when x is greater than or equal to 'a'.
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.                                     Chapter 8
  1815.  
  1816.                               Special Applications
  1817.  
  1818.  
  1819.  
  1820.  
  1821.        8.1 Omitted Dependent Variable
  1822.  
  1823.        There is a class of nonlinear regression problems that can be  best
  1824.        expressed  by  omitting  the dependent variable (i.e., the variable
  1825.        on the left of the equal sign).   To  understand  what  this  means
  1826.        first   consider  the  normal  regression  case  with  a  dependent
  1827.        variable.  For each observation the function is evaluated  and  the
  1828.        computed  value  is  subtracted from the corresponding value of the
  1829.        dependent variable for that observation.  This  residual  value  is
  1830.        then  squared  and added to the other squared residual values.  The
  1831.        goal is to minimize the total sum of  squared  residuals.   In  the
  1832.        case  where  the  dependent  variable  is  omitted, the function is
  1833.        computed for each observation and the  value  of  the  function  is
  1834.        squared  (i.e.,  it  is  treated  as the residual) and added to the
  1835.        other squared values.  The goal is  to  minimize  the  sum  of  the
  1836.        squared  values  of  the  function.   Thus,  for  a perfect fit the
  1837.        computed value of the  function  for  every  observation  would  be
  1838.        zero.
  1839.  
  1840.        To  perform  this  type of analysis omit the dependent variable and
  1841.        equal sign from the left side of the function specification.
  1842.  
  1843.        As an example of this type of  analysis  consider  the  problem  of
  1844.        fitting  a  circle  to a set of points that form a roughly circular
  1845.        pattern (i.e., a "circular regression").  Our goal is to  determine
  1846.        the  center  point  of  the circle (Xc,Yc) and the radius (R) which
  1847.        will make the circle best fit the points so that  the  sum  of  the
  1848.        squared  distances  between  the  points  and  the perimeter of the
  1849.        circle is minimized (the points are as close to  the  perimeter  of
  1850.        the circle as possible).
  1851.  
  1852.        For  this  problem  we have three parameters whose values are to be
  1853.        determined: Xc, Yc, and R.  There will be one data observation  for
  1854.        each  point  to  which  the circle is being fitted.  For each point
  1855.        there are two variables, Xp and Yp, the X and Y coordinates of  the
  1856.        point's position.
  1857.  
  1858.        Since  our  goal  is  to  minimize the sum of the squared distances
  1859.        from the points to the perimeter of the circle, we need a  function
  1860.        that  will  compute this distance for each point.  If the center of
  1861.        the circle is at (Xc,Yc) and the position of  a  point  is  (Xp,Yp)
  1862.        then,  from  the  theorem  of Pythagoras, we know the distance from
  1863.        the center to the point is
  1864.  
  1865.  
  1866.                                        33
  1867.  
  1868.        Chapter 8. Special Applications                                  34
  1869.  
  1870.  
  1871.             SQRT((Xp-Xc)^2 + (Yp-Yc)^2)
  1872.  
  1873.        But we are interested in the distance from  the  perimeter  to  the
  1874.        point.   Since the radius of the circle is R, the distance from the
  1875.        perimeter to the point (along a straight line from  the  center  to
  1876.        the point) is
  1877.  
  1878.             SQRT((Xp-Xc)^2 + (Yp-Yc)^2) - R
  1879.  
  1880.        That  is,  the distance from the perimeter to the point is equal to
  1881.        the distance from the center to the point less  the  distance  from
  1882.        the  center  to  the  perimeter (the radius).  The distance will be
  1883.        positive or negative depending on whether the point is  outside  or
  1884.        inside  the  circle  but  this  does  not matter since the value is
  1885.        squared as part of the minimization process.
  1886.  
  1887.        The Nonlin statements for this analysis are as follows:
  1888.  
  1889.             VARIABLES  Xp,Yp
  1890.             PARAMETERS Xc,Yc,R
  1891.             FUNCTION   SQRT((Xp-Xc)^2 + (Yp-Yc)^2) - R
  1892.  
  1893.        Note that there is no dependent variable or equal sign to the  left
  1894.        of   the  function.   Nonlin  will  determine  the  values  of  the
  1895.        parameters Yp, Yc, and R such that the sum of  the  squared  values
  1896.        of  the  function  (i.e.,  the  sum  of  the  squared distances) is
  1897.        minimized.  The CIRCLE.NLR file contains a  full  example  of  this
  1898.        analysis.
  1899.  
  1900.        As  a second example similar to the first one, consider a town that
  1901.        is trying to decide where to place a fire  station.   The  location
  1902.        should  be  central such that the sum of the squared distances from
  1903.        the station to each house is minimized.   Nonlin  can  be  used  to
  1904.        determine  the  coordinates  of  the station (Xc,Yc) given a set of
  1905.        coordinates for each house location (Xh,Yh)  by  using  a  slightly
  1906.        simpler function than the first example:
  1907.  
  1908.             FUNCTION  SQRT((Xh-Xc)^2 + (Yh-Yc)^2)
  1909.  
  1910.        As  a  third example, consider a position finding problem.  Several
  1911.        observers  are  positioned  at  known  locations.   Each   observer
  1912.        measures  the  compass bearing of an object whose position is to be
  1913.        determined.  The problem is to best estimate the  position  of  the
  1914.        object.   Since  each bearing measurement will have some element of
  1915.        error, the lines of position from the observers to the object  will
  1916.        not  intersect  at an exact point.  Nonlin can be used to determine
  1917.        the best estimate of the object's position (Xp,Yp)  such  that  the
  1918.        sum  of  the  squared  distances  from the lines of position to the
  1919.        object is minimized.  Each data record has three values: the X  and
  1920.        Y  positions  of  an observer and the compass bearing to the object
  1921.        (north is 0 degrees, east is 90, etc.).
  1922.  
  1923.        The equation for a line  passing  through  an  observer's  position
  1924.        (Xo,Yo) with slope 'm' is
  1925.  
  1926.        Chapter 8. Special Applications                                  35
  1927.  
  1928.  
  1929.             Y = m*X - m*Xo + Yo
  1930.  
  1931.        The  perpendicular  distance  from  a  line  to a point at location
  1932.        (Xp,Yp) is
  1933.  
  1934.             abs(m*Xp - Yp + Yo - m*Xo) / sqrt(m^2 + 1)
  1935.  
  1936.        This is  the  function  whose  sum  of  squared  values  is  to  be
  1937.        minimized.   The  following expression converts the compass bearing
  1938.        to a slope
  1939.  
  1940.             tan(rad(90-angle))
  1941.  
  1942.        The POSITION.NLR file contains an example of this analysis.
  1943.  
  1944.  
  1945.        8.2 Root Finding and Expression Minimization
  1946.  
  1947.        Although it is designed for nonlinear regression  analysis,  Nonlin
  1948.        can  also be used to find the root (zero point) or minimum absolute
  1949.        value of a nonlinear expression.  To use  Nonlin  in  this  fashion
  1950.        follow these steps:
  1951.  
  1952.          . Do not use any VARIABLE statements.
  1953.  
  1954.          . Use  PARAMETER  statements  to  specify  the names and optional
  1955.            starting values for the  parameters  whose  values  are  to  be
  1956.            determined as the roots or minimum value of the expression.
  1957.  
  1958.          . Use  the  FUNCTION  statement  to  specify the expression whose
  1959.            roots or minimum value  is  to  be  found;  do  NOT  specify  a
  1960.            dependent   variable   and  equal  sign  --  specify  only  the
  1961.            expression that is to be minimized.
  1962.  
  1963.          . Do not include any data records after the  DATA  statement;  it
  1964.            simply  signals  the  end  of  the  command file and causes the
  1965.            analysis to begin.
  1966.  
  1967.        The following is an example command file to find the  root  of  the
  1968.        expression SIN(X)-LOG(X):
  1969.  
  1970.             PARAMETER X
  1971.             FUNCTION SIN(X) - LOG(X)
  1972.             DATA
  1973.  
  1974.        Notice  that  the  "variable" in the expression, X, is not declared
  1975.        to be a variable but rather a parameter.  This example is  included
  1976.        in the file MINSL.NLR which you can run.
  1977.  
  1978.        For  this  type  of  analysis,  Nonlin determines the values of the
  1979.        parameters that minimize the absolute value of the expression.   If
  1980.        the  expression  has  a  zero  value  (i.e., a root), that value is
  1981.        found since that is the smallest possible absolute value.   If  the
  1982.        expression  does  not  have  a  zero  point,  Nonlin determines the
  1983.        values of the parameters that produce the smallest  absolute  value
  1984.  
  1985.        Chapter 8. Special Applications                                  36
  1986.  
  1987.  
  1988.        of  the  expression.  For example, the expression 2*x^2-3*x+10 does
  1989.        not have a root but reaches a minimum value  of  8.875  when  x  is
  1990.        0.75.  The MINPAROB.NLR command file contains this example.
  1991.  
  1992.        There  are  a  number of cautions that you should keep in mind when
  1993.        using Nonlin to find roots or minimum values:
  1994.  
  1995.          . Nonlin will find only one root or minimum value  per  analysis.
  1996.            For  example,  the  expression  9-x^2 has two roots: -3 and +3.
  1997.            Nonlin will find one of the roots; which one it  finds  depends
  1998.            on the starting value specified for X.
  1999.  
  2000.          . Nonlin will find only real roots, not complex.
  2001.  
  2002.          . If  the expression contains a local minimum, Nonlin may find it
  2003.            rather than the global minimum or root.  Of course, if you  are
  2004.            looking  for  a local minimum in a certain region this could be
  2005.            considered   a   feature.    For   example,   the    expression
  2006.            0.5*x^3+5*(x-2)^2+15  has  a local minimum at x=1.61 and a root
  2007.            at x=-13.38.  If the starting value of x is less than -8.3  the
  2008.            root  is found; if the starting value is greater than -8.3, the
  2009.            local minimum is found.  If  the  expression  contains  only  a
  2010.            single  variable,  use  the  Mathplot  program  to  graphically
  2011.            display the expression and determine a good starting value  for
  2012.            the  variable  (see  page  40  for additional information about
  2013.            Mathplot).  The SWEEP command can also be used to try  multiple
  2014.            starting values when searching for a global minimum.
  2015.  
  2016.        8.2.1 Function Minimization Examples
  2017.  
  2018.        MINFALL.NLR  --  The  time  taken  for  an  object  to slide down a
  2019.            frictionless guide from  position  (0,h)  to  another  position
  2020.            (d,0)  (i.e.,  falling  through  a  distance  'h'  while moving
  2021.            horizontally a distance 'd')  depends  on  the  path  that  the
  2022.            object  takes  as  it follows the guide.  It turns out that the
  2023.            path that minimizes the descent time is  not  a  straight  line
  2024.            from   (0,h)   to   (d,0)   but   rather   a   curve  called  a
  2025.            brachistochrone with a steeper slope near the  beginning,  that
  2026.            gives  the  object  a  chance to accelerate quickly, and then a
  2027.            shallower slope further on.
  2028.  
  2029.            Finding the shape of this curve is a  classic  problem  in  the
  2030.            branch  of  mathematics called the Calculus of Variations.  The
  2031.            MINFALL example solves a simpler  case  of  this  problem:  the
  2032.            object  slides  along  a  straight  guide  from  (0,1000) to an
  2033.            intermediate position (px,py), and then along another  straight
  2034.            guide   from   (px,py)   to  (1000,0).   What  point,  (px,py),
  2035.            minimizes the descent time?
  2036.  
  2037.            Note concerning the answer: The fall time for the object if  it
  2038.            follows  a  straight  guide from (0,1000) to (1000,0) is 2.0203
  2039.            seconds; the fall time if it follows the two straight  segments
  2040.            found  by  MINFALL  is  1.8748; the fall time if it follows the
  2041.            ideal curved brachistochrone  is  1.8590.   The  speed  of  the
  2042.  
  2043.        Chapter 8. Special Applications                                  37
  2044.  
  2045.  
  2046.            object  at  the  end  of the fall is the same regardless of the
  2047.            path taken (conservation of energy).
  2048.  
  2049.        MINFUEL.NLR -- A lunar lander is hovering above the surface of  the
  2050.            moon  looking  for  a suitable landing site.  Available fuel is
  2051.            critical and the desired site is 200  meters  away.   How  long
  2052.            should  the  horizontal thruster be fired to start and stop the
  2053.            motion over the ground?  The vertical  thruster  must  be  used
  2054.            continuously  to  keep  the  lander  from  being  pulled to the
  2055.            surface.   If  too  little  horizontal  thrust  is   used   the
  2056.            spacecraft  will  move slowly and much fuel will be consumed by
  2057.            the   vertical   thruster   counterbalancing    the    downward
  2058.            gravitational  pull  while  hovering  over the surface.  On the
  2059.            other hand, if the horizontal thruster  is  fired  for  a  long
  2060.            time,   the   spacecraft  will  move  quickly  (minimizing  the
  2061.            hovering time) but excessive  fuel  will  be  used  during  the
  2062.            horizontal    acceleration   and   deceleration.    MINFUEL.NLR
  2063.            determines how long the thruster should  be  fired  during  the
  2064.            start   and   stop  accelerations  such  that  the  total  fuel
  2065.            consumption (start thrust + stop thrust + hover) is minimized.
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.                                     Chapter 9
  2073.  
  2074.                         Acknowledgement and Use of Nonlin
  2075.  
  2076.  
  2077.  
  2078.  
  2079.        9.1 Acknowledgement
  2080.  
  2081.        The nonlinear regression algorithm used by Nonlin was published  in
  2082.        ACM   Transactions  on  Mathematical  Software  7,3  (Sept.   1981)
  2083.        "Dennis,  J.E.,  Gay,  D.M.,  and  Welsch,  R.E.   --  An  adaptive
  2084.        nonlinear least-squares algorithm."
  2085.  
  2086.        9.2 Use and Distribution of Nonlin
  2087.  
  2088.        There  are  two  versions  of  the  Nonlin  program:  shareware and
  2089.        registered.  You are  welcome  to  make  copies  of  the  shareware
  2090.        version  of Nonlin and pass them on to friends or post this program
  2091.        on bulletin boards or  distribute  it  via  disk  catalog  services
  2092.        provided   the  entire  Nonlin  distribution  is  included  in  its
  2093.        original, unmodified form.  A distribution fee may be  charged  for
  2094.        the  cost  of the diskette, shipping and handling.  However, Nonlin
  2095.        may not be sold, or incorporated in another product that  is  sold,
  2096.        without  the  permission  of  Phillip  H.   Sherrod.   Vendors  are
  2097.        encouraged to contact the author to get the most recent version  of
  2098.        Nonlin.
  2099.  
  2100.        As  a shareware product, you are granted a no-cost, trial period of
  2101.        30 days during which you may evaluate Nonlin.  If you  find  Nonlin
  2102.        to  be  useful,  educational,  and/or entertaining, and continue to
  2103.        use it beyond  the  30  day  trial  period,  you  are  required  to
  2104.        compensate  the  author by sending the registration form printed at
  2105.        the  end  of  this  document  (and  in   REGISTER.DOC)   with   the
  2106.        appropriate  registration  fee  to  help  cover the development and
  2107.        support of Nonlin.
  2108.  
  2109.        In return for registering,  you  will  be  authorized  to  continue
  2110.        using  Nonlin  beyond  the  trial  period  and  you  will receive a
  2111.        registered version of the program, a laser-printed,  bound  manual,
  2112.        and  three  months  of  support via telephone, mail, or CompuServe.
  2113.        Your registration fee will be refunded if you encounter  a  serious
  2114.        bug that cannot be corrected.
  2115.  
  2116.        The  registered  version of Nonlin omits the shareware notification
  2117.        screen at the start of the run and does not require you to press  a
  2118.        key  to  proceed  with  the  analysis.  The registered version also
  2119.        includes the ability to print plots on HP LaserJet  printers.   The
  2120.        registered  version  of  Nonlin  is  NOT  shareware  and may not be
  2121.        redistributed or used on more than one computer system.
  2122.  
  2123.  
  2124.                                        38
  2125.  
  2126.        Chapter 9. Acknowledgement and Use of Nonlin                     39
  2127.  
  2128.  
  2129.        The author frequently improves Nonlin and it  is  likely  that  the
  2130.        version  you  have  is not the most recent version.  Note, the cost
  2131.        of registering Nonlin  is  insignificant  compared  with  what  you
  2132.        would  have  to  pay  to  purchase a commercial statistical package
  2133.        with an equivalent regression capability.
  2134.  
  2135.        9.3 Association of Shareware Professionals
  2136.  
  2137.        This program  is  produced  by  a  member  of  the  Association  of
  2138.        Shareware  Professionals  (ASP).   ASP  wants to make sure that the
  2139.        shareware principle works for you.  If you are unable to resolve  a
  2140.        shareware-related  problem  with  an  ASP  member by contacting the
  2141.        member directly, ASP may be able to help.  The  ASP  Ombudsman  can
  2142.        help  you resolve a dispute or problem with an ASP member, but does
  2143.        not provide technical support for members' products.  Please  write
  2144.        to  the  ASP  Ombudsman  at  545 Grover Road, Muskegon, MI 49442 or
  2145.        send a CompuServe message via  CompuServe  Mail  to  ASP  Ombudsman
  2146.        7007,3536.
  2147.  
  2148.        You are welcome to contact the author:
  2149.  
  2150.                                Phillip H. Sherrod
  2151.                                 4410 Gerald Place
  2152.                          Nashville, TN  37205-3806  USA
  2153.                              615-292-2881 (evenings)
  2154.                              CompuServe: 76166,2640
  2155.                        Internet: 76166.2640@compuserve.com
  2156.  
  2157.        9.4 Copyright Notice
  2158.  
  2159.        Both  the  Nonlin  program  and  documentation  are  copyright  (c)
  2160.        1992-1993 by Phillip  H.   Sherrod.   You  are  not  authorized  to
  2161.        modify the program.  "Nonlin" is a trademark.
  2162.  
  2163.        9.5 Disclaimer
  2164.  
  2165.        Nonlin  is  provided  "as  is" without warranty of any kind, either
  2166.        expressed  or  implied.   This  program  may  contain  "bugs"   and
  2167.        inaccuracies,  and  its results should not be assumed to be correct
  2168.        unless they are verified by independent means.  The author  assumes
  2169.        no   responsibility   for  the  use  of  Nonlin  and  will  not  be
  2170.        responsible for any damage resulting from its use.
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.                                    Chapter 10
  2178.  
  2179.                                  Other Software
  2180.  
  2181.  
  2182.  
  2183.  
  2184.        10.1 Mathplot -- Mathematical Function Plotting Program
  2185.  
  2186.        If you like Nonlin, you should check out the  Mathplot  program  by
  2187.        the same author.
  2188.  
  2189.        Mathplot  allows  you to specify complicated mathematical functions
  2190.        using ordinary algebraic expressions  and  immediately  plot  them.
  2191.        Four  types  of  functions  may  be  specified: cartesian (Y=f(X));
  2192.        parametric cartesian (Y=f(T) and X=f(T)); polar  (Radius=f(Angle));
  2193.        and  parametric  polar  (Radius=f(T)  and  Angle=f(T)).  Up to four
  2194.        functions may be plotted  simultaneously.   Scaling  is  automatic.
  2195.        Options  are available to control axis display and labeling as well
  2196.        as grid lines.  Hard copy  output  may  be  generated  as  well  as
  2197.        screen   display.    Mathplot  is  an  ideal  tool  for  engineers,
  2198.        scientists, math and science teachers, and anyone  else  who  needs
  2199.        to quickly visualize mathematical functions.
  2200.  
  2201.        If  you  register  Nonlin  and order Mathplot at the same time, you
  2202.        can get both for $40.
  2203.  
  2204.        10.2 TSX-32 -- Multi-User Operating System
  2205.  
  2206.        If you have  a  need  for  a  multi-user,  multi-tasking  operating
  2207.        system,  you  should  look into TSX-32.  TSX-32 is a full-featured,
  2208.        high performance, multi-user operating system for the 386  and  486
  2209.        that  provides  both  32-bit  and  16-bit  program  support.   With
  2210.        facilities such  as  multitasking  and  multisessions,  networking,
  2211.        virtual  memory,  X-Windows, background batch queues, data caching,
  2212.        file  access  control,  real-time,  and  dial-in  support,   TSX-32
  2213.        provides a solid environment for a wide range of applications.
  2214.  
  2215.        A  two  user,  shareware  version of TSX-32 called TSX-Lite is also
  2216.        available.
  2217.  
  2218.        TSX-32 is not a limited, 16-bit, multi-DOS add-on.  Rather,  it  is
  2219.        a  complete  32-bit  operating  system  which makes full use of the
  2220.        hardware's potential, including protected mode  execution,  virtual
  2221.        memory,  and  demand paging.  TSX-32 sites range from small systems
  2222.        with 2-3  terminals  to  large  installations  with  more  than  64
  2223.        terminals on a single 386.
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.                                        40
  2230.  
  2231.        Chapter 10. Other Software                                       41
  2232.  
  2233.  
  2234.        In  addition to supporting most popular 16-bit DOS programs, TSX-32
  2235.        also provides a 32-bit "flat" address space with both Phar Lap  and
  2236.        DPMI compatible modes of execution.
  2237.  
  2238.        Since  the  DOS  file  structure  is  standard  for TSX-32, you can
  2239.        directly read and write DOS disks.  And, you can run  DOS  part  of
  2240.        the time and TSX-32 the rest of the time on the same computer.
  2241.  
  2242.        TSX-32  allows  each  user  to control up to 10 sessions.  Programs
  2243.        can also "fork"  subtasks  for  multi-threaded  applications.   The
  2244.        patented  Adaptive  Scheduling Algorithm provides consistently good
  2245.        response time under varying conditions.
  2246.  
  2247.        The  TSX-32  network  option  provides  industry  standard   TCP/IP
  2248.        networking  through Ethernet and serial lines.  Programs can access
  2249.        files on remote machines as easily as on their  own  machine.   The
  2250.        SET  HOST  command allows a user on one machine to log onto another
  2251.        computer in the network.  FTP, Telnet, and NFS  are  available  for
  2252.        interoperability with other systems.
  2253.  
  2254.        TSX-32  is,  quite  simply,  the  best  and most powerful operating
  2255.        system available for the 386 and 486.  For  additional  information
  2256.        contact:
  2257.  
  2258.                            S&H Computer Systems, Inc.
  2259.                              1027 17th Avenue South
  2260.                              Nashville, TN 37212 USA
  2261.                               615-327-3670 (voice)
  2262.                                615-321-5929 (fax)
  2263.                               CompuServe: 71333,27
  2264.                         Internet: 71333.27@compuserve.com
  2265.  
  2266.  
  2267.        10.3 SIMSTAT -- Interactive Statistics Program
  2268.  
  2269.        If  you need a general-purpose statistical package, or would like a
  2270.        menu-oriented, mouse-aware interface to Nonlin, I suggest  you  try
  2271.        the SIMSTAT program written by Normand Peladeau.
  2272.  
  2273.        SIMSTAT  is  a  menu  driven statistical program that provides many
  2274.        basic  descriptive  and  comparative  statistics  and  includes   a
  2275.        "bridge"  module  to allow it to function as a "front end" and data
  2276.        editor for Nonlin.
  2277.  
  2278.        The shareware version of  SIMSTAT  is  available  from  the  IBMAPP
  2279.        forum  of  CompuServe  and  from  many  BBS, or you can contact the
  2280.        author at the address below.   SIMSTAT  version  2.1  or  later  is
  2281.        required  for  use  with  Nonlin.   You must also have the "bridge"
  2282.        module called SIM2NL.  SIM2NL.ZIP is included on  the  distribution
  2283.        disk with the registered version of Nonlin.
  2284.  
  2285.        For  information about SIMSTAT, contact: Normand Peladeau, Provalis
  2286.        Research,  5000  Adam  Street,  Montreal,  QC  H1V   1W5,   Canada,
  2287.        Compuserve: [71760,2103], Internet: 71760.2103@compuserve.com.
  2288.  
  2289.          ===============================================================
  2290.                                Software Order Form
  2291.          ===============================================================
  2292.  
  2293.        Name ______________________________________________________
  2294.  
  2295.        Address ___________________________________________________
  2296.  
  2297.        City _______________________  State _______ Zip ___________
  2298.  
  2299.        Country ____________________  Telephone ___________________
  2300.  
  2301.        CompuServe account (optional) _____________________________
  2302.  
  2303.        Nonlin version ____________________________________________
  2304.  
  2305.        Bulletin board where you found Nonlin _____________________
  2306.  
  2307.        Comments __________________________________________________
  2308.  
  2309.        Check the box below which indicates your order type:
  2310.  
  2311.            ___ I wish to register Nonlin ($25).
  2312.  
  2313.            ___ I wish to order Mathplot ($20).
  2314.  
  2315.            ___ I wish to register Nonlin and order Mathplot ($40).
  2316.  
  2317.        Add  $5  to any amount shown above if the software is being shipped
  2318.        out of the United States.
  2319.  
  2320.        In return for registering, you will receive the registered  version
  2321.        of  the  program,  a  laser-printed,  bound copy of the manual, and
  2322.        three  months   of   telephone   or   CompuServe   support.    Your
  2323.        registration  fee  will  be refunded if you find a serious bug that
  2324.        cannot be corrected.
  2325.  
  2326.        Distribution disk choice (check one):
  2327.  
  2328.              3.50" HD (1.4 MB)  ______
  2329.              5.25" HD (1.2 MB)  ______
  2330.              5.25" DD (360 KB)  ______
  2331.  
  2332.        Send this form with the amount indicated to the author:
  2333.  
  2334.                                Phillip H. Sherrod
  2335.                                 4410 Gerald Place
  2336.                           Nashville, TN  37205-3806 USA
  2337.  
  2338.                              615-292-2881 (evenings)
  2339.                              CompuServe: 76166,2640
  2340.                        Internet: 76166.2640@compuserve.com
  2341.  
  2342.        Index                                                            43
  2343.  
  2344.  
  2345.        80x87 coprocessor, 29              Degrees to radians, 8
  2346.        ABS function, 7                    Deviation
  2347.        Absolute converge, 26                 average, 22
  2348.        Acknowledgement, 38                   definition, 2
  2349.        ACOS function, 7                      maximum, 22
  2350.        Adaptive algorithm, 25             Diode current example, 32
  2351.        AFCTOL value, 25                   Direction finder example, 34
  2352.        AIDS growth curve, 30              Disclaimer, 39
  2353.        Arc cosine function, 7             DPMI support, 40
  2354.        Arc sine function, 7               Durbin-Watson statistic, 23
  2355.        Arc tangent function, 7            E constant, 6
  2356.        Arighmetic operators, 6            EI2 function, 7
  2357.        ASIN function, 7                   EIC1 function, 7
  2358.        ASP, 39                            EIC2 function, 7
  2359.        Assn. of Shareware Prof., 39       EL1 function, 7
  2360.        Asymptotic function example,       Elliptic integral function, 7
  2361.                 30                        ERF function, 7
  2362.        ATAN function, 7                   Examples, 30
  2363.        Author address, 39                    AIDS growth curve, 30
  2364.        Autoregression test, 18, 23           asymptotic function, 30
  2365.        Average deviation, 22                 AVL tree, 32
  2366.        AVL tree example, 32                  boiling water, 31
  2367.        Bessel function, 8, 9                 cooling, 31
  2368.        Beta function, 7                      diode current, 32
  2369.        BETAI function, 7                     function minimization, 36
  2370.        Brachistochrone, 36                   linear regression, 30
  2371.        Build-in functions, 7                 lunar lander, 37
  2372.        Built-in constants, 6                 magnet force, 32
  2373.        Calculus of variations, 36            minimum time path, 36
  2374.        Chebyshev function, 9                 multivariate, 30
  2375.        Circular regression, 33               negative exponential, 31
  2376.        Clapeyron's equation, 31              piecewise function, 32
  2377.        Command files, 9                      quadratic equation, 30
  2378.        Commands, 11                          square wave, 31
  2379.        Comments in command files, 9          SWEEP command, 31
  2380.        CompuServe, 39, 41                 EXP function, 8
  2381.        CONFIDENCE command, 12, 22         Exponentation operator, 6
  2382.        Confidence intervals, 12           Expression minimization, 35
  2383.        CONSTANT command, 6, 12            FAC function, 8
  2384.        CONSTRAIN command, 13, 28          Factorial function, 8
  2385.        Continuation of lines, 9           Fire station example, 34
  2386.        Convergence criterion, 25          FUNCTION command, 14
  2387.           absolute, 26                    Function minimization, 35
  2388.           relative, 26                    Functions, 7
  2389.        Convergence failures, 27           GAMMA function, 8
  2390.        Cooling example, 31                GAMMAI function, 8
  2391.        Copyright notice, 39               GAMMALN function, 8
  2392.        COS function, 7                    Gauss-Newton algorithm, 25
  2393.        Cosecant function, 7               Growth curve, 30
  2394.        COSH function, 7                   HAV function, 8
  2395.        COT function, 7                    Hessian, 25
  2396.        COVARIANCE command, 13             Hyperbolic cosine function, 7
  2397.        CSC function, 7                    Hyperbolic sine function, 9
  2398.        DATA command, 19                   Hyperbolic tangent function,
  2399.        DEG function, 7                             9
  2400.  
  2401.        Index                                                            44
  2402.  
  2403.  
  2404.        Incomplete beta function, 7        $OBS variable, 15
  2405.        Installing Nonlin, 3               Order form, 42
  2406.        Internet, 39, 41                   OUTPUT command, 15
  2407.        Inverse gamma function, 8          PARAMETER command
  2408.        ITERATIONS command, 14                function minimization, 35
  2409.        J0 function, 8                     PARAMETERS command, 11
  2410.        J1 function, 8                     PAREA function, 8
  2411.        JN function, 8                     Performance issues, 28
  2412.        LaserJet                           PI constant, 6
  2413.        LaserJet printer, 3, 38            Piecewise function example,
  2414.           resolution, 19                           32
  2415.        Least squares regression, 2        PLOT command, 16
  2416.        Levenberg-Marquardt, 25               options, 16
  2417.        Limits, 29                         Plots
  2418.        Linear regression, 1                  data and function, 16
  2419.           example, 30                        normal probability, 18
  2420.        Listing file, 5                       residual values, 17
  2421.        LOG function, 8                       resolution, 19
  2422.        Log gamma function, 8                 width of, 19
  2423.        LOG10 function, 8                  Polynomial equation example,
  2424.        LOG2 function, 8                            30
  2425.        Logistic curve, 30                 Position finding example, 34
  2426.        Lunar lander example, 37           POUTPUT command, 16
  2427.        Magnet example, 32                    extra precision output, 21
  2428.        Marquardt algorithm, 25            $PREDICTED variable, 15
  2429.        Mathplot, 40                       PRESOLUTION command, 19
  2430.        MAX function, 8                    Prob(t) value, 22
  2431.        Maximum values, 21                 Program limits, 29
  2432.        MIN function, 8                    PULSE function, 8
  2433.        Minimiation algorithm, 25          Quadratic equation example,
  2434.        Minimization problem, 35                    30
  2435.        Model/trust region, 25             RAD function, 8
  2436.        Multi-user operating system,       Radian to degree conversion,
  2437.                 40                                 7
  2438.        Multiple determination, 22         Ra^2 statistic, 23
  2439.        Multivariate regression, 30        Real-time, 40
  2440.        Mutually dependent, 28             REGISTER command, 15
  2441.        Natural log function, 8            REGISTER.DOC file, 3
  2442.        Negative exponential, 2, 31        Registering Nonlin, 38
  2443.        Networking, 41                     Registration form, 42
  2444.        NOECHO command, 19                 Relative convergence, 26
  2445.        NONLIN environment variable,       Residual
  2446.                 3                         Residual values
  2447.        NONLIN.DOC file, 3                    plotting, 17
  2448.        NONLIN.EXE file, 3                 $RESIDUAL variable, 15
  2449.        NONLIN.FON file, 3, 16                average, 22
  2450.        NONLIN.LJF file, 3                    definition, 2
  2451.        NORMAL function, 8                    maximum, 22
  2452.        Normal probablity plot, 18         RFCTOL value, 25
  2453.        NPD function, 8                    Root finding, 35
  2454.        NPLOT command, 18                  RPLOT command, 17
  2455.           autocorrelation test, 24           autocorrelation test, 24
  2456.           options, 18                        options, 18
  2457.        Numeric constants, 6               R^2 statistic, 22
  2458.        Numeric coprocessor, 29            S&H Computer Systems, Inc.,
  2459.  
  2460.        Index                                                            45
  2461.  
  2462.  
  2463.                 41
  2464.        SEC function, 9
  2465.        Secant function, 9
  2466.        SEL function, 9
  2467.        SET command, 3
  2468.        Sherrod, Phillip H., 39
  2469.        SIM2NL, 41
  2470.        SIMSTAT, 41
  2471.        SIN function, 9
  2472.        Singular matrix problems, 28
  2473.        SINH function, 9
  2474.        SQRT function, 9
  2475.        Square wave example, 31
  2476.        Standard deviation, 21
  2477.        Standard error function, 7
  2478.        STEP function, 9
  2479.        Support of Nonlin, 38
  2480.        SWEEP command, 13
  2481.           convergence failure, 27
  2482.           example, 31
  2483.           function minimization, 36
  2484.           performance issues, 29
  2485.        Symbolic constants, 6
  2486.        T function, 9
  2487.        t statistic, 21, 22
  2488.        TAN function, 9
  2489.        TANH function, 9
  2490.        TCP/IP, 41
  2491.        Theory of operation, 25
  2492.        Time series data, 23
  2493.        TITLE command, 11
  2494.        TOLERANCE command, 14, 15
  2495.           converge criterion, 25
  2496.        TSX-32, 40
  2497.        TSX-Lite, 40
  2498.        Use and distribution, 38
  2499.        VARIABLES command, 11
  2500.        Variance-covariance matrix,
  2501.                 13
  2502.        Warranty, 39
  2503.        WIDTH command, 19
  2504.        X windows, 40
  2505.        Y0 function, 9
  2506.        Y1 function, 9
  2507.        YN function, 9
  2508.