## Info

That's right, we've added 16K more memory. but kept the price at a low $2495! The TRS-80 Model III is a complete, ready-to-run desktop computer packed with "extras" that don't cost extra:

Two Double-Density Disk Drives. You get two built-in 175K disk drives, and can add up to two more externally

BASIC in 14K ROM. Our powerful Model III BASIC provides a program line editor, machine language programming, real time clock, and more. Compatible with most-Model I Level II BASIC programs, too. Plus, you can expand with COBOL or Compiler BASIC any time.

Built-in Monitor. 12." high-resolution.

12-Key Datapad. As well as repeating keys and keyboard-controlled screen print.

Parallel Printer Port. Add one of our printers anytime.

RS-232 Serial Interface. For data communications. just add a modem.

Nationwide Support. Backed by 6100 Radio Shack stores and dealers. 160 Computer Centers and 160 service centers throughout the USA

Available Now. Why pay more? Get a demonstration today. Also check out our

Retail prices may vary at individual stores and dealers. Special order may be required

Because You Get 48K at Last Year's 32K Price!

Upper and Lower Case Characters. With a special graphics character set. and 64 characters-per-line format.

Regression II Dynacomp Pittsford, NY $19.95 cassette $23.95 disk by Bruce Douglass

Dynacomp's Regression II is, as far as I know, the only non-linear regression program commercially presently available for any microcomputer. Non-linear regression is a complex, sophisticated technique. Probably because of this it has a smaller audience than it deserves. This program is one-dimensional, that is, it can handle one independent variable and one dependent variable.

There are three main approaches to nonlinear regression: Taylor series approximation, steepest descent (gradient) method, and the Marquardt method which is an optimization ofthe previous two. The last is the most sophisticated algorithm and is used as the default algorithm in SAS (Statistical Analysis System) NLIN programs on mainframe computers.

What is done, essentially, is in a problem with N parameters. That is, when the fitting function to which you wish to regress the data has N unknown constants that you wish to determine, it finds the values of the parameters that gives the minimum sum of squares between the actual and predicted values of the dependent variable. That sounds worse than it actually is.

All that is meant is that we define a function SS = I((Y'(i)- Y(i))*(Y'(i) - Y(i))) called the Sum of Squares. Y' is the value predicted for the dependent variable for the i-th value of the independent variable by the fitting function. Y is the actual value that occurs with the i-th value of the independent variable (X(i)).

As you can see, the better the fit of the regression, the closer the predicted and actual values for Y will be. This will make SS smaller and smaller. There is a theoretical limit for how close you may come to predicting the actual Y value, and it is determined by the relationship of the form of the fitting function with what the real relationship Is as well as the random chance variation (noise) that occurs in the data itself. In other words, some functions will fit the data better than others and, for any given fúnctjon, how well it fits is dependent on the noise in the data.

Although Ahere is a certain amount of evidence that for some classes of functions least squares methodology will result in non-homogenous error variance, leasl squares is most commonly used because of ease of both comprehension and implementation.

Although there is a certain amount of evidence that for some classes of functions, least-squares methodology will result in non-homogenous error variance, least squares is most commonly used because of ease of both comprehension and implementation.

The First Two Methods

The first two methods of non-linear regression have their problems. The first,

"The program structure has some non-optimal characteristics."

Taylor series approximation, attempts to locate the optimal parameters in N-space by using a series expansion. This method has its downfalls. For example, if the initial estimates of the values of the parameters are not close enough to being correct the approximation may get lost and settle for a local minimum. However, its advantage is that when the initial estimates are close, it rapidly converges the optimal values.

The method of steepest descent looks around for the steepest slope (gradient) of the surface in the parameter space and follows it to the minimum values. This method is less likely to be fooled by local minimums, but, as it gets closer and closer to the actual values, the rate of convergence typically slows to a crawl.

The Dynacomp program uses the steep-est-descent method, and, therefore, is reasonably stable in its convergence to the optimal parameters. It can take a long time to converge if you choose the wrong function, the data is noisy or there are a large number of parameters to be fitted.

Like most scientists, I have a streak of pedantry in my blood and would like to take this moment to point out to the people of Dynacomp that they are using the divergence of the vector in the parameter space, and not the gradient, when they add the partial derivatives of the parameters. The manual states otherwise.

The documentation that accompanies the program is mediocre. It does mention the method and algorithm used with a certain amount of completeness, but it is on ly moderately useful. In the space used it would have been even more educational (if that was their purpose) to delineate the routines used and their relationship to the algorithm.

The documentation mentions that there is one functional form that this program is not good at regressing, but it remains for the reader to discover what that is. It is only mentioned in one of the two examples given. It turns out that polynomial regression is not well regressed.

The examples are run with comments and cover everything that is in the program. Since the program asks the operator for all inputs, this merely serves to reinforce the user's understanding of operation. In this sense, it is useful.

The program structure has some non-optimal characteristics. It is available for several computers and looks as though it was written so that it could be easily used on a variety of computers rather than any one given computer. This is evident in the graphic routine, the lack of multi-state-ment lines and the filler lines that take up memory but don't contribute at all to the program.

### Graphing Routines

Let's consider the graphing routines first. Data points are printed out on the screen using "*" for data. The graphs often scroll the screen, so the user does not get a good picture of the behavior of the function (which is one of the purposes of a graph.) The values of the data points may be printed on the screen at the user's option. On a TRS-80 with Set/Reset resolution, which is six times the resolution one gets with using "*" to represent data points, why use the latter? If you are out-putting to a printer, it makes sense, but not to the screen.

True, you can control the height of the graphs but not directly, and often the graph scrolls to graph the data. I consider

that unacceptable.

Listing the program, you will notice an interesting program construction:

• No multi-statement lines.

• No Defint for iooping variables.

• Up to six separate lines of Print statements followed by a CLS (clear screen command).

Since this is an iterative program, using multi-statement lines and Defint for loop variables would greatly reduce run-time.

Also, the Print statements (up to six separate lines) are followed by a CLS? If readability was the object, then one REM line is worth 10 times its weight in useless Print statements.

The program comes on both disk and tape. Being cheap, I bought the tape version and adapted it for sequential disk files. It runs nicely and even has the capability of editing the source file. Editing consists of changing, deleting or inserting data points. This- routine is useful and works well. The program lists the data by page so that it will not scroli.

Before running the program, the function containing the parameters must be

## Post a comment