C-PLOT

Scientific Graphics and Data Analysis

12.6.1. - Description of the fit output



For the example that follows, the sample data is listed under the sa command below. The fitting function is the fit to a line that appears in the prototype module, described at the end of this chapter.

Before the first iteration of the fit, the program prints information in the following format:
July 6, 1992
Fitting 11 points.  2 parameters varied.  0 fixed.  Phi = 514.9.

Number             Name  Is fit?  Deriv?  Initial Value
0         Constant term    YES      YES      0.1
1           Linear term    YES      YES      0.9
Phi (Φ) is the sum of the squares of the differences between the y-values of the data points and values calculated with the current parameters. The table lists the parameter number, name, whether or not that parameter is being fit, whether or not the user function supplies an analytic derivative for that parameter and the starting value for that parameter.

A typical fit produces output in the form:
Iteration #1        Phi = 10.02  Chi-Squared = 1.114
11:01pm (0.2u 0.1s) Lambda = 0.01 Gamma = 23.68 Step = 17.38

0       Constant term = 15.5308 delta = 15.4308
1       Linear term = 3.63904   delta = 2.73904

Iteration #2        Phi = 9.792  Chi-Squared = 1.088
11:01pm (0.3u 0.3s) Lambda = 0.001 Gamma = 64.35 Step = 2.964

0       Constant term = 10.4579 delta = -5.07289
1       Linear term = 4.00195   delta = 0.362915

Iteration #3        Phi = 9.792  Chi-Squared = 1.088
11:01pm (0.5u 0.4s) Lambda = 0.0001 Gamma = 1.533 Step = 0.1285

0       Constant term = 10.2319 delta = -0.226027
1       Linear term = 4.01728   delta = 0.0153272

Convergence by epsilon test in 4 iterations.

Iteration #4        Phi = 9.792  Chi-Squared = 1.088
11:01pm (0.6u 0.6s) Lambda = 1e-05 Gamma = 0.0179 Step = 0.00056

0       Constant term = 10.2309 delta = -0.000984272
1       Linear term = 4.01735   delta = 6.6703e-05


Chi-squared (χ2) is simply Φ divided by the number of degrees of freedom (the number of fitted points minus the number of fitted parameters). The numbers in parentheses after the time of day are the cumulative user and system CPU times for this fit.

Lambda (λ) is the current value of the Marquardt compromise parameter. Gamma (γ) represents the angle between the direction of the gradient at the current point on the χ2 hypersurface and the direction taken during this iteration. Step is the distance in scaled parameter space traveled during this iteration.

At each iteration for each fitted parameter the current value of the parameter is printed along with the change in its value from the last iteration.

The iterations cease when either the iteration limit is reached or one of the convergence criteria is satisfied. The possible convergence messages are:

Convergence by epsilon test. The ε test is the usual convergence test and is performed after each iteration where Φ has decreased for the given value of λ. The test is satisfied if, for each parameter bi and parameter increment δbi, |δbi|/(τ + |bi|) < ε, where the values of τ and ε are set with the fc command.

Convergence by gamma-epsilon test. If Φ hasn't decreased but γ has fallen below the critical value established with the fc command, the parameter increments are continually halved and the ε test is performed. If the test is satisfied, you will see this message. If Φ has increased with the halved increments, the previous values of the parameters will be maintained and you will see the message "Correction vector for last iteration not used"." If the ε test is not satisfied and Φ decreases with the halved increments, the fit will proceed to the next iteration.

Convergence by gamma-lambda test. If Φ has decreased but γ has exceeded 90 degrees and λ has exceeded 1, this message is printed. The message might more appropriately read "non-convergence ," since the conditions causing this message generally indicate a pathological situation possibly caused by errors in the model equation or inappropriate values for the current parameters or the data.

Typing ^C while fitting halts the fit and restores parameters to their values as of the last completed iteration.