PreviousTable of ContentsNext


The ConvergenceTest Option

The ConvergenceTest option allows the user to control when the fit is considered to have converged. It only has meaning when the data have declared errors in both coordinates and the default Brent minimisation has either been turned off or the fit is not to a straight line.

The default setting for the option is Automatic. In this case the fit is declared to have converged when either of the following conditions are true:

For example, we fit some synthetic data by Pearson and York to a straight line, and use the capability to later view the progress of the fit from the Fit Results screen by choosing the Progress of Mathematica during the computation button to monitor the fit. We have also set the Brent option discussed above to False. Here is a summary of what the fitter reported about its own progress:

10 data points, each with 4 variables.
Iteration 1 using SingularValues.
  Chi-squared = 34.1661
  Parameter values: {6.09873, -0.610542}
  Calculated effective variance: 
  {1.00019, 0.746249, 0.500744, 0.354659, 
  0.228121, 0.234169, 0.143571, 
  0.181761, 0.465955, 0.612198}
Iteration 2 using SingularValues.
  Chi-squared = 10.6139
  Parameter values: {5.39787, -0.464026}
  Calculated effective variance: 
  {1.00011, 0.746144, 0.50043, 0.354381, 
   0.22639, 0.229929, 0.134122, 
   0.158636, 0.360051, 0.466203}
Iteration 3 using SingularValues.
  Chi-squared = 11.9079
  Parameter values: {5.39669, -0.463556}
  Calculated effective variance: 
  {1.00011, 0.746144, 0.500429, 0.35438, 
  0.226385, 0.229917, 0.134095, 
  0.158567, 0.359714, 0.465735}
Iteration 4 using SingularValues.
  Chi-squared = 11.9128
  Parameter values: {5.39673, -0.463563}
  Calculated effective variance: 
  {1.00011, 0.746144, 0.500429, 0.35438, 
  0.226385, 0.229917, 0.134095, 
  0.158568, 0.359719, 0.465742}
Iteration 5 using SingularValues.
  Chi-squared = 11.9128
  Parameter values: {5.39673, -0.463563}
  Calculated effective variance: 
  {1.00011, 0.746144, 0.500429, 0.35438, 
  0.226385, 0.229917, 0.134095, 
  0.158568, 0.359719, 0.465742}
Calculating covariance matrix.
Adjusting significant figures of parameters.

The values returned by the fitter are:

A0 = 5.40 ± 0.30
A1 = -0.464 ± 0.058
Chi Squared = 11.9128

Say we decide that the convergence test will be when the maximum change in the values of the fitted parameters is less than 10% of those of the previous iteration. Then we set the form as follows:

ConvergenceTest


(default: Automatic)

This option only has meaning when the data has declared errors in both coordinates and the Brent option is set to False. In this case if ConvergenceTest is Automatic, the default, then the iterated fit is declared to have converged when either the ChiSquared per DegreesOfFreedom is less than 0.001 or the ChiSquared is decreasing and in the current iteration has decreased by less than 10% from the previous iteration.

ConvergenceTest may be set to any boolean-valued Mathematica expression, expressed in terms of chisq (the ChiSquared of the current iteration), oldchisq (the ChiSquared of the previous iteration), dof (the DegreesOfFreedom of the fit), values (a list of the current values of the fitted parameters) and oldvalues (a list of the values of the fitted parameters from the previous iteration).

The expression is expected to evaluate to True if the fit has converged, False otherwise. On the first iteration, oldchisq is $MaxMachineNumber and oldvalues is a list of length equal to the number of factors each element of which is equal to $MaxMachineNumber.

The convergence test field above reads Max[Abs[1 - values/oldvalues]] < 0.10, which you may confirm by clicking in the box and scrolling back and forth with the arrow keys on your keyboard.

Repeating the fit gives the following progress report:

10 data points, each with 4 variables.
Iteration 1 using SingularValues.
Chi-squared = 34.1661
Parameter values: {6.09873, -0.610542}
Calculated effective variance: {1.00019, 0.746249, 
    0.500744, 0.354659, 0.228121, 0.234169, 
    0.143571, 0.181761, 0.465955, 
    0.612198}
Iteration 2 using SingularValues.
Chi-squared = 10.6139
Parameter values: {5.39787, -0.464026}
Calculated effective variance: {1.00011, 0.746144, 
    0.50043, 0.354381, 0.22639, 0.229929, 
    0.134122, 0.158636, 0.360051, 
    0.466203}
Iteration 3 using SingularValues.
Chi-squared = 11.9079
Parameter values: {5.39669, -0.463556}
Calculated effective variance: {1.00011, 0.746144, 
    0.500429, 0.35438, 0.226385, 0.229917, 
    0.134095, 0.158567, 0.359714, 
    0.465735}
Calculating covariance matrix.
Adjusting significant figures of parameters.

This time LinearFit has decided that the fit converged after three iterations, instead of the five iterations before. The fit parameters are, within the significant figures displayed, identical with the previous fit.


PreviousTable of ContentsNext


Authors

This help document is Copyright © 1999 David M. Harrison. The sample screens are Copyright © 1999 Solomon R.C. Douglas and David M. Harrison. This is version 1.1 of the help document, date (m/d/y) 11/25/99.