Estimating and Calculating AccuracyAn important way to quantify the accuracy of the solution of a linear system is to compute the condition number . This is defined as follows for a suitable choice of norm. It can be shown that for the matrix equation the relative error in is times the relative error in and . Thus, the condition number quantifies the accuracy of the solution. If the condition number of a matrix is large, the matrix is said to be ill-conditioned. You cannot expect a good solution from an ill-conditioned system. For some extremely ill-conditioned systems it is not possible to obtain any solution. In Mathematica an approximation of the condition number is computed with the function MatrixConditionNumber, which is loaded from the package MatrixManipulation. In[1]:=  |
This computes the condition number of a matrix. In[2]:=  |
Out[3]=
|
This matrix is singular and the condition number is . In[4]:=  |
Out[5]=
|
This matrix has a large condition number and is said to be ill-conditioned. In[6]:=  |
Out[7]=
|
If a matrix is multiplied with itself, the condition number increases. In[8]:=  |
Out[9]=
|
When you solve a matrix equation involving an ill-conditioned matrix, the result may not be as accurate. In[10]:=  |
Out[12]=
|
The solution is less accurate for the matrix mat2. In[13]:=  |
Out[14]=
|
The solution to these problems is to avoid constructing matrices that may be ill-conditioned, for example, by avoiding multiplying matrices by themselves. Another method of solving problems more accurately is to use Mathematica arbitrary-precision computation; this is discussed in the section Arbitrary-Precision Matrices. In[15]:=  |
Out[17]=
|
|