C-PLOT

Scientific Graphics and Data Analysis

12.2. - Introduction to the fitting package



The fits are normally run as type-5 user functions, and you should refer to the general description of user functions (the fn command) in Chapter 10. The command-file facility in fit is identical to that in C-PLOT. When invoking fits from plot command files, you can have a separate command file for the fit function, in which case you would enter from the plot program:
fn fitfunc.5 cmd_file cmd_file_args ...
The command file should terminate with an ex to ensure that control passes back to the plot program at the end of the command file.

Alternatively, you can include the fit commands in the C-PLOT command file using the syntax:
fn fitfunc.5 ->
...
ex
All the commands between the fn and ex will be executed by the fit function. To continue running the current function you can use:
fn -
...
ex
The fits also can be run as independent processes from the shell.

An explanation of the nonlinear least-squares fitting algorithm used in this software, the Marquardt algorithm, can be found in chapter 11 of the book Data Reduction and Error Analysis for the Physical Sciences by Philip R. Bevington (New York, McGraw-Hill, 1969).