When the method of doing the fit is LUD (cf. the Method option below), then the calculation of the covariance matrix by default uses Mathematica's Inverse function.
Sometimes, this calculation is not stable. If InverseMethod is set to SVD, then singular value decomposition is used instead of Inverse; this will often be more stable.
Reference: J. Stoer and R. Burlisch, Introduction to Numerical Analysis (Springer, 1980).
We will fit some data on a thermocouple calibration to a cubic polynomial. We will set the Method to LUD and leave the InverseMethod to be its default.
The numerical results of the fit are:
A0 = -0.876 ±
0.037 A1 = -0.338 ± 0.033 A2 = -0.000097 ± 0.000077 A3 = -2.5 × 10-7 ± 5.1 × 10-7 Chi Squared = 0.769614 for 17 degrees of freedom (Chi-squared probability: 100.) |
A couple of points to note about the fit:
Examining the progress of the fit with the Progress of Mathematica during the computation button on the Fit Results screen shows:
21 data points, each with 3 variables. |
Iteration 1 using LUD routines. |
LUDecomposition::luc: Result for LUDecomposition of badly conditioned matrix {{8400., 420000., 2.87 107 , 2.205 109 }, <<3>>} may contain significant numerical errors. |
Chi-squared = 0.769614 |
-7 Parameter values: {-0.875698, 0.0337949, 0.000096794, -2.46708 10 } |
Calculating covariance matrix. |
Inverse::luc: Result for Inverse of
badly conditioned matrix {{8400., 420000., 2.87 107 , 2.205 109 }, <<3>>} may contain significant numerical errors. |
Adjusting significant figures of parameters. |
The warning message from LUDecomposition and its significance are discussed in the section on the Method Option. We can use a singular value decomposition (SVD) to calculate the inverse and eliminate the warning when we calculate the covariance matrix.
The primary reason why the fitter uses Inverse by default to calculate the covariance matrix when the Method is LUD is because this is commonly how conventional least-squares fitters do it. We shall comment further on the stability of the fit used as an example above in the discussion of the Method Option.
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.